re PR other/40302 (GCC must hard-require MPC before release)

PR other/40302
	* builtins.c: Remove HAVE_mpc* checks throughout.
	* fold-const.c: Likewise.
	* real.h: Likewise.
	* toplev.c: Likewise.

From-SVN: r155046
This commit is contained in:
Kaveh R. Ghazi 2009-12-07 15:42:55 +00:00 committed by Kaveh Ghazi
parent 197eb5a168
commit 16a19648a2
5 changed files with 11 additions and 50 deletions

View File

@ -1,3 +1,11 @@
2009-12-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR other/40302
* builtins.c: Remove HAVE_mpc* checks throughout.
* fold-const.c: Likewise.
* real.h: Likewise.
* toplev.c: Likewise.
2009-12-07 Edmar Wienskoski <edmar@freescale.com>
* config.gcc (cpu_is_64bit): Add new core e500mc64.

View File

@ -58,9 +58,7 @@ along with GCC; see the file COPYING3. If not see
#ifndef PAD_VARARGS_DOWN
#define PAD_VARARGS_DOWN BYTES_BIG_ENDIAN
#endif
#ifdef HAVE_mpc
static tree do_mpc_arg1 (tree, tree, int (*)(mpc_ptr, mpc_srcptr, mpc_rnd_t));
#endif
/* Define the names of the builtin function types and codes. */
const char *const built_in_class_names[4]
@ -7152,20 +7150,17 @@ fold_builtin_cosh (location_t loc, tree arg, tree type, tree fndecl)
NULL_TREE if no simplification can be made. */
static tree
fold_builtin_ccos (location_t loc,
tree arg, tree type ATTRIBUTE_UNUSED, tree fndecl,
bool hyper ATTRIBUTE_UNUSED)
fold_builtin_ccos (location_t loc, tree arg, tree type, tree fndecl,
bool hyper)
{
if (validate_arg (arg, COMPLEX_TYPE)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg))) == REAL_TYPE)
{
tree tmp;
#ifdef HAVE_mpc
/* Calculate the result when the argument is a constant. */
if ((tmp = do_mpc_arg1 (arg, type, (hyper ? mpc_cosh : mpc_cos))))
return tmp;
#endif
/* Optimize fn(-x) into fn(x). */
if ((tmp = fold_strip_sign_ops (arg)))
@ -7250,19 +7245,15 @@ fold_builtin_cexp (location_t loc, tree arg0, tree type)
{
tree rtype;
tree realp, imagp, ifn;
#ifdef HAVE_mpc
tree res;
#endif
if (!validate_arg (arg0, COMPLEX_TYPE)
|| TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) != REAL_TYPE)
return NULL_TREE;
#ifdef HAVE_mpc
/* Calculate the result when the argument is a constant. */
if ((res = do_mpc_arg1 (arg0, type, mpc_exp)))
return res;
#endif
rtype = TREE_TYPE (TREE_TYPE (arg0));
@ -9700,7 +9691,6 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore)
CASE_FLT_FN (BUILT_IN_CCOSH):
return fold_builtin_ccos(loc, arg0, type, fndecl, /*hyper=*/ true);
#ifdef HAVE_mpc
CASE_FLT_FN (BUILT_IN_CSIN):
if (validate_arg (arg0, COMPLEX_TYPE)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
@ -9737,7 +9727,6 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore)
return do_mpc_arg1 (arg0, type, mpc_sqrt);
break;
#ifdef HAVE_mpc_arc
CASE_FLT_FN (BUILT_IN_CASIN):
if (validate_arg (arg0, COMPLEX_TYPE)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
@ -9773,8 +9762,6 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
return do_mpc_arg1 (arg0, type, mpc_atanh);
break;
#endif /* HAVE_mpc_arc */
#endif /* HAVE_mpc */
CASE_FLT_FN (BUILT_IN_CABS):
return fold_builtin_cabs (loc, arg0, type, fndecl);
@ -10092,7 +10079,6 @@ fold_builtin_2 (location_t loc, tree fndecl, tree arg0, tree arg1, bool ignore)
CASE_FLT_FN (BUILT_IN_HYPOT):
return fold_builtin_hypot (loc, fndecl, arg0, arg1, type);
#ifdef HAVE_mpc_pow
CASE_FLT_FN (BUILT_IN_CPOW):
if (validate_arg (arg0, COMPLEX_TYPE)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE
@ -10100,7 +10086,6 @@ fold_builtin_2 (location_t loc, tree fndecl, tree arg0, tree arg1, bool ignore)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg1))) == REAL_TYPE)
return do_mpc_arg2 (arg0, arg1, type, /*do_nonfinite=*/ 0, mpc_pow);
break;
#endif
CASE_FLT_FN (BUILT_IN_LDEXP):
return fold_builtin_load_exponent (loc, arg0, arg1, type, /*ldexp=*/true);
@ -12720,7 +12705,6 @@ do_mpfr_ckconv (mpfr_srcptr m, tree type, int inexact)
return NULL_TREE;
}
#ifdef HAVE_mpc
/* Helper function for do_mpc_arg*(). Ensure M is a normal complex
number and no overflow/underflow occurred. INEXACT is true if M
was not exactly calculated. TYPE is the tree type for the result.
@ -12767,7 +12751,6 @@ do_mpc_ckconv (mpc_srcptr m, tree type, int inexact, int force_convert)
}
return NULL_TREE;
}
#endif /* HAVE_mpc */
/* If argument ARG is a REAL_CST, call the one-argument mpfr function
FUNC on it and return the resulting value as a tree with type TYPE.
@ -13165,7 +13148,6 @@ do_mpfr_lgamma_r (tree arg, tree arg_sg, tree type)
return result;
}
#ifdef HAVE_mpc
/* If argument ARG is a COMPLEX_CST, call the one-argument mpc
function FUNC on it and return the resulting value as a tree with
type TYPE. The mpfr precision is set to the precision of TYPE. We
@ -13219,7 +13201,6 @@ do_mpc_arg1 (tree arg, tree type, int (*func)(mpc_ptr, mpc_srcptr, mpc_rnd_t))
DO_NONFINITE is true, then fold expressions containing Inf or NaN
in the arguments and/or results. */
#ifdef HAVE_mpc
tree
do_mpc_arg2 (tree arg0, tree arg1, tree type, int do_nonfinite,
int (*func)(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t))
@ -13270,8 +13251,6 @@ do_mpc_arg2 (tree arg0, tree arg1, tree type, int do_nonfinite,
return result;
}
# endif
#endif /* HAVE_mpc */
/* FIXME tuples.
The functions below provide an alternate interface for folding

View File

@ -1962,12 +1962,10 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
break;
case MULT_EXPR:
#ifdef HAVE_mpc
if (COMPLEX_FLOAT_TYPE_P (type))
return do_mpc_arg2 (arg1, arg2, type,
/* do_nonfinite= */ folding_initializer,
mpc_mul);
#endif
real = const_binop (MINUS_EXPR,
const_binop (MULT_EXPR, r1, r2, notrunc),
@ -1980,14 +1978,11 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
break;
case RDIV_EXPR:
#ifdef HAVE_mpc
if (COMPLEX_FLOAT_TYPE_P (type))
return do_mpc_arg2 (arg1, arg2, type,
/* do_nonfinite= */ folding_initializer,
mpc_div);
/* Fallthru ... */
#endif
case TRUNC_DIV_EXPR:
case CEIL_DIV_EXPR:
case FLOOR_DIV_EXPR:

View File

@ -24,18 +24,8 @@
#ifndef GENERATOR_FILE
#include <gmp.h>
#include <mpfr.h>
#ifdef HAVE_mpc
#include <mpc.h>
# ifdef HAVE_mpc
extern tree do_mpc_arg2 (tree, tree, tree, int, int (*)(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t));
# endif
# if MPC_VERSION >= MPC_VERSION_NUM(0,6,1)
# define HAVE_mpc_pow
# endif
# if MPC_VERSION >= MPC_VERSION_NUM(0,7,1)
# define HAVE_mpc_arc
# endif
#endif
#endif
#include "machmode.h"

View File

@ -1198,13 +1198,8 @@ print_version (FILE *file, const char *indent)
N_("%s%s%s %sversion %s (%s) compiled by CC, ")
#endif
;
#ifdef HAVE_mpc
static const char fmt2[] =
N_("GMP version %s, MPFR version %s, MPC version %s\n");
#else
static const char fmt2[] =
N_("GMP version %s, MPFR version %s\n");
#endif
static const char fmt3[] =
N_("%s%swarning: %s header version %s differs from library version %s.\n");
static const char fmt4[] =
@ -1236,11 +1231,7 @@ print_version (FILE *file, const char *indent)
#endif
fprintf (file,
file == stderr ? _(fmt2) : fmt2,
GCC_GMP_STRINGIFY_VERSION, MPFR_VERSION_STRING
#ifdef HAVE_mpc
, MPC_VERSION_STRING
#endif
);
GCC_GMP_STRINGIFY_VERSION, MPFR_VERSION_STRING, MPC_VERSION_STRING);
if (strcmp (GCC_GMP_STRINGIFY_VERSION, gmp_version))
fprintf (file,
file == stderr ? _(fmt3) : fmt3,
@ -1251,13 +1242,11 @@ print_version (FILE *file, const char *indent)
file == stderr ? _(fmt3) : fmt3,
indent, *indent != 0 ? " " : "",
"MPFR", MPFR_VERSION_STRING, mpfr_get_version ());
#ifdef HAVE_mpc
if (strcmp (MPC_VERSION_STRING, mpc_get_version ()))
fprintf (file,
file == stderr ? _(fmt3) : fmt3,
indent, *indent != 0 ? " " : "",
"MPC", MPC_VERSION_STRING, mpc_get_version ());
#endif
fprintf (file,
file == stderr ? _(fmt4) : fmt4,
indent, *indent != 0 ? " " : "",