Commit 16a19648 by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent 197eb5a1
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> 2009-12-07 Edmar Wienskoski <edmar@freescale.com>
* config.gcc (cpu_is_64bit): Add new core e500mc64. * config.gcc (cpu_is_64bit): Add new core e500mc64.
...@@ -58,9 +58,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -58,9 +58,7 @@ along with GCC; see the file COPYING3. If not see
#ifndef PAD_VARARGS_DOWN #ifndef PAD_VARARGS_DOWN
#define PAD_VARARGS_DOWN BYTES_BIG_ENDIAN #define PAD_VARARGS_DOWN BYTES_BIG_ENDIAN
#endif #endif
#ifdef HAVE_mpc
static tree do_mpc_arg1 (tree, tree, int (*)(mpc_ptr, mpc_srcptr, mpc_rnd_t)); 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. */ /* Define the names of the builtin function types and codes. */
const char *const built_in_class_names[4] const char *const built_in_class_names[4]
...@@ -7152,20 +7150,17 @@ fold_builtin_cosh (location_t loc, tree arg, tree type, tree fndecl) ...@@ -7152,20 +7150,17 @@ fold_builtin_cosh (location_t loc, tree arg, tree type, tree fndecl)
NULL_TREE if no simplification can be made. */ NULL_TREE if no simplification can be made. */
static tree static tree
fold_builtin_ccos (location_t loc, fold_builtin_ccos (location_t loc, tree arg, tree type, tree fndecl,
tree arg, tree type ATTRIBUTE_UNUSED, tree fndecl, bool hyper)
bool hyper ATTRIBUTE_UNUSED)
{ {
if (validate_arg (arg, COMPLEX_TYPE) if (validate_arg (arg, COMPLEX_TYPE)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg))) == REAL_TYPE) && TREE_CODE (TREE_TYPE (TREE_TYPE (arg))) == REAL_TYPE)
{ {
tree tmp; tree tmp;
#ifdef HAVE_mpc
/* Calculate the result when the argument is a constant. */ /* Calculate the result when the argument is a constant. */
if ((tmp = do_mpc_arg1 (arg, type, (hyper ? mpc_cosh : mpc_cos)))) if ((tmp = do_mpc_arg1 (arg, type, (hyper ? mpc_cosh : mpc_cos))))
return tmp; return tmp;
#endif
/* Optimize fn(-x) into fn(x). */ /* Optimize fn(-x) into fn(x). */
if ((tmp = fold_strip_sign_ops (arg))) if ((tmp = fold_strip_sign_ops (arg)))
...@@ -7250,19 +7245,15 @@ fold_builtin_cexp (location_t loc, tree arg0, tree type) ...@@ -7250,19 +7245,15 @@ fold_builtin_cexp (location_t loc, tree arg0, tree type)
{ {
tree rtype; tree rtype;
tree realp, imagp, ifn; tree realp, imagp, ifn;
#ifdef HAVE_mpc
tree res; tree res;
#endif
if (!validate_arg (arg0, COMPLEX_TYPE) if (!validate_arg (arg0, COMPLEX_TYPE)
|| TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) != REAL_TYPE) || TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) != REAL_TYPE)
return NULL_TREE; return NULL_TREE;
#ifdef HAVE_mpc
/* Calculate the result when the argument is a constant. */ /* Calculate the result when the argument is a constant. */
if ((res = do_mpc_arg1 (arg0, type, mpc_exp))) if ((res = do_mpc_arg1 (arg0, type, mpc_exp)))
return res; return res;
#endif
rtype = TREE_TYPE (TREE_TYPE (arg0)); rtype = TREE_TYPE (TREE_TYPE (arg0));
...@@ -9700,7 +9691,6 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore) ...@@ -9700,7 +9691,6 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore)
CASE_FLT_FN (BUILT_IN_CCOSH): CASE_FLT_FN (BUILT_IN_CCOSH):
return fold_builtin_ccos(loc, arg0, type, fndecl, /*hyper=*/ true); return fold_builtin_ccos(loc, arg0, type, fndecl, /*hyper=*/ true);
#ifdef HAVE_mpc
CASE_FLT_FN (BUILT_IN_CSIN): CASE_FLT_FN (BUILT_IN_CSIN):
if (validate_arg (arg0, COMPLEX_TYPE) if (validate_arg (arg0, COMPLEX_TYPE)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_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) ...@@ -9737,7 +9727,6 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore)
return do_mpc_arg1 (arg0, type, mpc_sqrt); return do_mpc_arg1 (arg0, type, mpc_sqrt);
break; break;
#ifdef HAVE_mpc_arc
CASE_FLT_FN (BUILT_IN_CASIN): CASE_FLT_FN (BUILT_IN_CASIN):
if (validate_arg (arg0, COMPLEX_TYPE) if (validate_arg (arg0, COMPLEX_TYPE)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_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) ...@@ -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) && TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_TYPE)
return do_mpc_arg1 (arg0, type, mpc_atanh); return do_mpc_arg1 (arg0, type, mpc_atanh);
break; break;
#endif /* HAVE_mpc_arc */
#endif /* HAVE_mpc */
CASE_FLT_FN (BUILT_IN_CABS): CASE_FLT_FN (BUILT_IN_CABS):
return fold_builtin_cabs (loc, arg0, type, fndecl); 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) ...@@ -10092,7 +10079,6 @@ fold_builtin_2 (location_t loc, tree fndecl, tree arg0, tree arg1, bool ignore)
CASE_FLT_FN (BUILT_IN_HYPOT): CASE_FLT_FN (BUILT_IN_HYPOT):
return fold_builtin_hypot (loc, fndecl, arg0, arg1, type); return fold_builtin_hypot (loc, fndecl, arg0, arg1, type);
#ifdef HAVE_mpc_pow
CASE_FLT_FN (BUILT_IN_CPOW): CASE_FLT_FN (BUILT_IN_CPOW):
if (validate_arg (arg0, COMPLEX_TYPE) if (validate_arg (arg0, COMPLEX_TYPE)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (arg0))) == REAL_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) ...@@ -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) && TREE_CODE (TREE_TYPE (TREE_TYPE (arg1))) == REAL_TYPE)
return do_mpc_arg2 (arg0, arg1, type, /*do_nonfinite=*/ 0, mpc_pow); return do_mpc_arg2 (arg0, arg1, type, /*do_nonfinite=*/ 0, mpc_pow);
break; break;
#endif
CASE_FLT_FN (BUILT_IN_LDEXP): CASE_FLT_FN (BUILT_IN_LDEXP):
return fold_builtin_load_exponent (loc, arg0, arg1, type, /*ldexp=*/true); 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) ...@@ -12720,7 +12705,6 @@ do_mpfr_ckconv (mpfr_srcptr m, tree type, int inexact)
return NULL_TREE; return NULL_TREE;
} }
#ifdef HAVE_mpc
/* Helper function for do_mpc_arg*(). Ensure M is a normal complex /* Helper function for do_mpc_arg*(). Ensure M is a normal complex
number and no overflow/underflow occurred. INEXACT is true if M number and no overflow/underflow occurred. INEXACT is true if M
was not exactly calculated. TYPE is the tree type for the result. 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) ...@@ -12767,7 +12751,6 @@ do_mpc_ckconv (mpc_srcptr m, tree type, int inexact, int force_convert)
} }
return NULL_TREE; return NULL_TREE;
} }
#endif /* HAVE_mpc */
/* If argument ARG is a REAL_CST, call the one-argument mpfr function /* 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. 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) ...@@ -13165,7 +13148,6 @@ do_mpfr_lgamma_r (tree arg, tree arg_sg, tree type)
return result; return result;
} }
#ifdef HAVE_mpc
/* If argument ARG is a COMPLEX_CST, call the one-argument 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 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 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)) ...@@ -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 DO_NONFINITE is true, then fold expressions containing Inf or NaN
in the arguments and/or results. */ in the arguments and/or results. */
#ifdef HAVE_mpc
tree tree
do_mpc_arg2 (tree arg0, tree arg1, tree type, int do_nonfinite, do_mpc_arg2 (tree arg0, tree arg1, tree type, int do_nonfinite,
int (*func)(mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t)) 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, ...@@ -13270,8 +13251,6 @@ do_mpc_arg2 (tree arg0, tree arg1, tree type, int do_nonfinite,
return result; return result;
} }
# endif
#endif /* HAVE_mpc */
/* FIXME tuples. /* FIXME tuples.
The functions below provide an alternate interface for folding The functions below provide an alternate interface for folding
......
...@@ -1962,12 +1962,10 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc) ...@@ -1962,12 +1962,10 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
break; break;
case MULT_EXPR: case MULT_EXPR:
#ifdef HAVE_mpc
if (COMPLEX_FLOAT_TYPE_P (type)) if (COMPLEX_FLOAT_TYPE_P (type))
return do_mpc_arg2 (arg1, arg2, type, return do_mpc_arg2 (arg1, arg2, type,
/* do_nonfinite= */ folding_initializer, /* do_nonfinite= */ folding_initializer,
mpc_mul); mpc_mul);
#endif
real = const_binop (MINUS_EXPR, real = const_binop (MINUS_EXPR,
const_binop (MULT_EXPR, r1, r2, notrunc), const_binop (MULT_EXPR, r1, r2, notrunc),
...@@ -1980,14 +1978,11 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc) ...@@ -1980,14 +1978,11 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
break; break;
case RDIV_EXPR: case RDIV_EXPR:
#ifdef HAVE_mpc
if (COMPLEX_FLOAT_TYPE_P (type)) if (COMPLEX_FLOAT_TYPE_P (type))
return do_mpc_arg2 (arg1, arg2, type, return do_mpc_arg2 (arg1, arg2, type,
/* do_nonfinite= */ folding_initializer, /* do_nonfinite= */ folding_initializer,
mpc_div); mpc_div);
/* Fallthru ... */ /* Fallthru ... */
#endif
case TRUNC_DIV_EXPR: case TRUNC_DIV_EXPR:
case CEIL_DIV_EXPR: case CEIL_DIV_EXPR:
case FLOOR_DIV_EXPR: case FLOOR_DIV_EXPR:
......
...@@ -24,18 +24,8 @@ ...@@ -24,18 +24,8 @@
#ifndef GENERATOR_FILE #ifndef GENERATOR_FILE
#include <gmp.h> #include <gmp.h>
#include <mpfr.h> #include <mpfr.h>
#ifdef HAVE_mpc
#include <mpc.h> #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)); 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 #endif
#include "machmode.h" #include "machmode.h"
......
...@@ -1198,13 +1198,8 @@ print_version (FILE *file, const char *indent) ...@@ -1198,13 +1198,8 @@ print_version (FILE *file, const char *indent)
N_("%s%s%s %sversion %s (%s) compiled by CC, ") N_("%s%s%s %sversion %s (%s) compiled by CC, ")
#endif #endif
; ;
#ifdef HAVE_mpc
static const char fmt2[] = static const char fmt2[] =
N_("GMP version %s, MPFR version %s, MPC version %s\n"); 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[] = static const char fmt3[] =
N_("%s%swarning: %s header version %s differs from library version %s.\n"); N_("%s%swarning: %s header version %s differs from library version %s.\n");
static const char fmt4[] = static const char fmt4[] =
...@@ -1236,11 +1231,7 @@ print_version (FILE *file, const char *indent) ...@@ -1236,11 +1231,7 @@ print_version (FILE *file, const char *indent)
#endif #endif
fprintf (file, fprintf (file,
file == stderr ? _(fmt2) : fmt2, file == stderr ? _(fmt2) : fmt2,
GCC_GMP_STRINGIFY_VERSION, MPFR_VERSION_STRING GCC_GMP_STRINGIFY_VERSION, MPFR_VERSION_STRING, MPC_VERSION_STRING);
#ifdef HAVE_mpc
, MPC_VERSION_STRING
#endif
);
if (strcmp (GCC_GMP_STRINGIFY_VERSION, gmp_version)) if (strcmp (GCC_GMP_STRINGIFY_VERSION, gmp_version))
fprintf (file, fprintf (file,
file == stderr ? _(fmt3) : fmt3, file == stderr ? _(fmt3) : fmt3,
...@@ -1251,13 +1242,11 @@ print_version (FILE *file, const char *indent) ...@@ -1251,13 +1242,11 @@ print_version (FILE *file, const char *indent)
file == stderr ? _(fmt3) : fmt3, file == stderr ? _(fmt3) : fmt3,
indent, *indent != 0 ? " " : "", indent, *indent != 0 ? " " : "",
"MPFR", MPFR_VERSION_STRING, mpfr_get_version ()); "MPFR", MPFR_VERSION_STRING, mpfr_get_version ());
#ifdef HAVE_mpc
if (strcmp (MPC_VERSION_STRING, mpc_get_version ())) if (strcmp (MPC_VERSION_STRING, mpc_get_version ()))
fprintf (file, fprintf (file,
file == stderr ? _(fmt3) : fmt3, file == stderr ? _(fmt3) : fmt3,
indent, *indent != 0 ? " " : "", indent, *indent != 0 ? " " : "",
"MPC", MPC_VERSION_STRING, mpc_get_version ()); "MPC", MPC_VERSION_STRING, mpc_get_version ());
#endif
fprintf (file, fprintf (file,
file == stderr ? _(fmt4) : fmt4, file == stderr ? _(fmt4) : fmt4,
indent, *indent != 0 ? " " : "", indent, *indent != 0 ? " " : "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment