Commit 455f14dd by Roger Sayle Committed by Roger Sayle

builtins.c (expand_builtin_pow, [...]): Replace uses of the macro…

builtins.c (expand_builtin_pow, [...]): Replace uses of the macro TREE_CONSTANT_OVERFLOW with TREE_OVERFLOW.


	* builtins.c (expand_builtin_pow, expand_builtin_powi,
	fold_builtin_cabs, fold_builtin_sqrt, fold_builtin_trunc,
	fold_builtin_floor, fold_builtin_ceil, fold_builtin_round,
	fold_builtin_int_int_roundingfn, fold_builtin_bitop,
	fold_builtin_bswap, real_constp, fold_builtin_pow,
	fold_builtin_powi, fold_builtin_signbit, fold_builtin_copysign,
	do_mpfr_arg1, do_mpfr_arg2, do_mpfr_arg3, do_mpfr_sincos): Replace
	uses of the macro TREE_CONSTANT_OVERFLOW with TREE_OVERFLOW.
	* convert.c (convert_to_pointer): Likewise.
	* expr.c (highest_pow2_factor, expand_expr_real_1): Likewise.
	* fold-const.c (force_fit_type, fold_negate_expr, int_const_binop,
	const_binop, fold_convert_const_int_from_int,
	fold_convert_const_int_from_real,
	fold_convert_const_real_from_real, sign_bit_p,
	optimize_minmax_comparison, extract_muldiv_1, fold_div_compare,
	fold_sign_changed_comparison, fold_unary, fold_comparison,
	fold_binary, multiple_of_p, tree_Expr_non_zero_p,
	fold_negate_const, fold_abs_const, fold_not_const): Likewise.
	* print-tree.c (print_node_brief, print_node): Likewise.
	* stor-layout.c (place_field, layout_type): Likewise.
	* tree-chrec.c (keep_cast): Likewise.
	* tree.c (build_vector, build_real, build_real_from_int_cst,
	build_complex): Likewise.

From-SVN: r120678
parent 95fd24b6
2007-01-11 Roger Sayle <roger@eyesopen.com>
* builtins.c (expand_builtin_pow, expand_builtin_powi,
fold_builtin_cabs, fold_builtin_sqrt, fold_builtin_trunc,
fold_builtin_floor, fold_builtin_ceil, fold_builtin_round,
fold_builtin_int_int_roundingfn, fold_builtin_bitop,
fold_builtin_bswap, real_constp, fold_builtin_pow,
fold_builtin_powi, fold_builtin_signbit, fold_builtin_copysign,
do_mpfr_arg1, do_mpfr_arg2, do_mpfr_arg3, do_mpfr_sincos): Replace
uses of the macro TREE_CONSTANT_OVERFLOW with TREE_OVERFLOW.
* convert.c (convert_to_pointer): Likewise.
* expr.c (highest_pow2_factor, expand_expr_real_1): Likewise.
* fold-const.c (force_fit_type, fold_negate_expr, int_const_binop,
const_binop, fold_convert_const_int_from_int,
fold_convert_const_int_from_real,
fold_convert_const_real_from_real, sign_bit_p,
optimize_minmax_comparison, extract_muldiv_1, fold_div_compare,
fold_sign_changed_comparison, fold_unary, fold_comparison,
fold_binary, multiple_of_p, tree_Expr_non_zero_p,
fold_negate_const, fold_abs_const, fold_not_const): Likewise.
* print-tree.c (print_node_brief, print_node): Likewise.
* stor-layout.c (place_field, layout_type): Likewise.
* tree-chrec.c (keep_cast): Likewise.
* tree.c (build_vector, build_real, build_real_from_int_cst,
build_complex): Likewise.
2007-01-11 Roger Sayle <roger@eyesopen.com>
* tree.h (TREE_CONSTANT_OVERFLOW): Obsolete. For the time being,
treat TREE_CONSTANT_OVERFLOW as a synonym of TREE_OVERFLOW.
......
/* Expand builtin functions.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
......@@ -2688,7 +2689,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
arg1 = TREE_VALUE (TREE_CHAIN (arglist));
if (TREE_CODE (arg1) != REAL_CST
|| TREE_CONSTANT_OVERFLOW (arg1))
|| TREE_OVERFLOW (arg1))
return expand_builtin_mathfn_2 (exp, target, subtarget);
/* Handle constant exponents. */
......@@ -2821,7 +2822,7 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget)
/* Handle constant power. */
if (TREE_CODE (arg1) == INTEGER_CST
&& ! TREE_CONSTANT_OVERFLOW (arg1))
&& !TREE_OVERFLOW (arg1))
{
HOST_WIDE_INT n = TREE_INT_CST_LOW (arg1);
......@@ -7013,8 +7014,8 @@ fold_builtin_cabs (tree arglist, tree type, tree fndecl)
&& TREE_CODE (arg) == COMPLEX_CST
&& TREE_CODE (TREE_REALPART (arg)) == REAL_CST
&& TREE_CODE (TREE_IMAGPART (arg)) == REAL_CST
&& ! TREE_CONSTANT_OVERFLOW (TREE_REALPART (arg))
&& ! TREE_CONSTANT_OVERFLOW (TREE_IMAGPART (arg)))
&& !TREE_OVERFLOW (TREE_REALPART (arg))
&& !TREE_OVERFLOW (TREE_IMAGPART (arg)))
{
REAL_VALUE_TYPE r, i;
......@@ -7092,7 +7093,7 @@ fold_builtin_sqrt (tree arglist, tree type)
/* Optimize sqrt of constant value. */
if (TREE_CODE (arg) == REAL_CST
&& ! TREE_CONSTANT_OVERFLOW (arg))
&& !TREE_OVERFLOW (arg))
{
REAL_VALUE_TYPE r, x;
......@@ -7441,7 +7442,7 @@ fold_builtin_trunc (tree fndecl, tree arglist)
/* Optimize trunc of constant value. */
arg = TREE_VALUE (arglist);
if (TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg))
if (TREE_CODE (arg) == REAL_CST && !TREE_OVERFLOW (arg))
{
REAL_VALUE_TYPE r, x;
tree type = TREE_TYPE (TREE_TYPE (fndecl));
......@@ -7467,7 +7468,7 @@ fold_builtin_floor (tree fndecl, tree arglist)
/* Optimize floor of constant value. */
arg = TREE_VALUE (arglist);
if (TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg))
if (TREE_CODE (arg) == REAL_CST && !TREE_OVERFLOW (arg))
{
REAL_VALUE_TYPE x;
......@@ -7506,7 +7507,7 @@ fold_builtin_ceil (tree fndecl, tree arglist)
/* Optimize ceil of constant value. */
arg = TREE_VALUE (arglist);
if (TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg))
if (TREE_CODE (arg) == REAL_CST && !TREE_OVERFLOW (arg))
{
REAL_VALUE_TYPE x;
......@@ -7537,7 +7538,7 @@ fold_builtin_round (tree fndecl, tree arglist)
/* Optimize round of constant value. */
arg = TREE_VALUE (arglist);
if (TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg))
if (TREE_CODE (arg) == REAL_CST && !TREE_OVERFLOW (arg))
{
REAL_VALUE_TYPE x;
......@@ -7569,7 +7570,7 @@ fold_builtin_int_roundingfn (tree fndecl, tree arglist)
/* Optimize lround of constant value. */
arg = TREE_VALUE (arglist);
if (TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg))
if (TREE_CODE (arg) == REAL_CST && !TREE_OVERFLOW (arg))
{
const REAL_VALUE_TYPE x = TREE_REAL_CST (arg);
......@@ -7637,7 +7638,7 @@ fold_builtin_bitop (tree fndecl, tree arglist)
/* Optimize for constant argument. */
arg = TREE_VALUE (arglist);
if (TREE_CODE (arg) == INTEGER_CST && ! TREE_CONSTANT_OVERFLOW (arg))
if (TREE_CODE (arg) == INTEGER_CST && !TREE_OVERFLOW (arg))
{
HOST_WIDE_INT hi, width, result;
unsigned HOST_WIDE_INT lo;
......@@ -7729,7 +7730,7 @@ fold_builtin_bswap (tree fndecl, tree arglist)
/* Optimize constant value. */
arg = TREE_VALUE (arglist);
if (TREE_CODE (arg) == INTEGER_CST && ! TREE_CONSTANT_OVERFLOW (arg))
if (TREE_CODE (arg) == INTEGER_CST && !TREE_OVERFLOW (arg))
{
HOST_WIDE_INT hi, width, r_hi = 0;
unsigned HOST_WIDE_INT lo, r_lo = 0;
......@@ -7786,7 +7787,7 @@ real_dconstp (tree expr, const REAL_VALUE_TYPE *value)
STRIP_NOPS (expr);
return ((TREE_CODE (expr) == REAL_CST
&& ! TREE_CONSTANT_OVERFLOW (expr)
&& !TREE_OVERFLOW (expr)
&& REAL_VALUES_EQUAL (TREE_REAL_CST (expr), *value))
|| (TREE_CODE (expr) == COMPLEX_CST
&& real_dconstp (TREE_REALPART (expr), value)
......@@ -7968,7 +7969,7 @@ fold_builtin_pow (tree fndecl, tree arglist, tree type)
return omit_one_operand (type, build_real (type, dconst1), arg1);
if (TREE_CODE (arg1) == REAL_CST
&& ! TREE_CONSTANT_OVERFLOW (arg1))
&& !TREE_OVERFLOW (arg1))
{
REAL_VALUE_TYPE cint;
REAL_VALUE_TYPE c;
......@@ -8027,7 +8028,7 @@ fold_builtin_pow (tree fndecl, tree arglist, tree type)
{
/* Attempt to evaluate pow at compile-time. */
if (TREE_CODE (arg0) == REAL_CST
&& ! TREE_CONSTANT_OVERFLOW (arg0))
&& !TREE_OVERFLOW (arg0))
{
REAL_VALUE_TYPE x;
bool inexact;
......@@ -8131,7 +8132,7 @@ fold_builtin_powi (tree fndecl ATTRIBUTE_UNUSED, tree arglist, tree type)
/* Evaluate powi at compile-time. */
if (TREE_CODE (arg0) == REAL_CST
&& ! TREE_CONSTANT_OVERFLOW (arg0))
&& !TREE_OVERFLOW (arg0))
{
REAL_VALUE_TYPE x;
x = TREE_REAL_CST (arg0);
......@@ -8819,7 +8820,7 @@ fold_builtin_signbit (tree fndecl, tree arglist)
/* If ARG is a compile-time constant, determine the result. */
if (TREE_CODE (arg) == REAL_CST
&& !TREE_CONSTANT_OVERFLOW (arg))
&& !TREE_OVERFLOW (arg))
{
REAL_VALUE_TYPE c;
......@@ -8861,8 +8862,8 @@ fold_builtin_copysign (tree fndecl, tree arglist, tree type)
/* If ARG1 and ARG2 are compile-time constants, determine the result. */
if (TREE_CODE (arg1) == REAL_CST
&& TREE_CODE (arg2) == REAL_CST
&& !TREE_CONSTANT_OVERFLOW (arg1)
&& !TREE_CONSTANT_OVERFLOW (arg2))
&& !TREE_OVERFLOW (arg1)
&& !TREE_OVERFLOW (arg2))
{
REAL_VALUE_TYPE c1, c2;
......@@ -11739,7 +11740,7 @@ do_mpfr_arg1 (tree arg, tree type, int (*func)(mpfr_ptr, mpfr_srcptr, mp_rnd_t),
/* To proceed, MPFR must exactly represent the target floating point
format, which only happens when the target base equals two. */
if (REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2
&& TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg))
&& TREE_CODE (arg) == REAL_CST && !TREE_OVERFLOW (arg))
{
const REAL_VALUE_TYPE *const ra = &TREE_REAL_CST (arg);
......@@ -11781,8 +11782,8 @@ do_mpfr_arg2 (tree arg1, tree arg2, tree type,
/* To proceed, MPFR must exactly represent the target floating point
format, which only happens when the target base equals two. */
if (REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2
&& TREE_CODE (arg1) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg1)
&& TREE_CODE (arg2) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg2))
&& TREE_CODE (arg1) == REAL_CST && !TREE_OVERFLOW (arg1)
&& TREE_CODE (arg2) == REAL_CST && !TREE_OVERFLOW (arg2))
{
const REAL_VALUE_TYPE *const ra1 = &TREE_REAL_CST (arg1);
const REAL_VALUE_TYPE *const ra2 = &TREE_REAL_CST (arg2);
......@@ -11826,9 +11827,9 @@ do_mpfr_arg3 (tree arg1, tree arg2, tree arg3, tree type,
/* To proceed, MPFR must exactly represent the target floating point
format, which only happens when the target base equals two. */
if (REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2
&& TREE_CODE (arg1) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg1)
&& TREE_CODE (arg2) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg2)
&& TREE_CODE (arg3) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg3))
&& TREE_CODE (arg1) == REAL_CST && !TREE_OVERFLOW (arg1)
&& TREE_CODE (arg2) == REAL_CST && !TREE_OVERFLOW (arg2)
&& TREE_CODE (arg3) == REAL_CST && !TREE_OVERFLOW (arg3))
{
const REAL_VALUE_TYPE *const ra1 = &TREE_REAL_CST (arg1);
const REAL_VALUE_TYPE *const ra2 = &TREE_REAL_CST (arg2);
......@@ -11874,7 +11875,8 @@ do_mpfr_sincos (tree arg, tree arg_sinp, tree arg_cosp)
/* To proceed, MPFR must exactly represent the target floating point
format, which only happens when the target base equals two. */
if (REAL_MODE_FORMAT (TYPE_MODE (type))->b == 2
&& TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg))
&& TREE_CODE (arg) == REAL_CST
&& !TREE_OVERFLOW (arg))
{
const REAL_VALUE_TYPE *const ra = &TREE_REAL_CST (arg);
......
/* Utility routines for data type conversion for GCC.
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1997, 1998,
2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
......@@ -47,7 +48,7 @@ convert_to_pointer (tree type, tree expr)
/* Propagate overflow to the NULL pointer. */
if (integer_zerop (expr))
return force_fit_type_double (type, 0, 0, 0, TREE_OVERFLOW (expr),
TREE_CONSTANT_OVERFLOW (expr));
false);
switch (TREE_CODE (TREE_TYPE (expr)))
{
......
/* Convert tree expression to rtl instructions, for GNU compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
Inc.
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
......@@ -6301,7 +6301,7 @@ highest_pow2_factor (tree exp)
a MIN_EXPR, or a MAX_EXPR. If the constant overflows, we have an
erroneous program, so return BIGGEST_ALIGNMENT to avoid any
later ICE. */
if (TREE_CONSTANT_OVERFLOW (exp))
if (TREE_OVERFLOW (exp))
return BIGGEST_ALIGNMENT;
else
{
......@@ -6969,7 +6969,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
simplified by validate_replace_rtx during virtual register
instantiation, which can result in unrecognizable insns.
Avoid this by forcing all overflows into registers. */
if (TREE_CONSTANT_OVERFLOW (exp)
if (TREE_OVERFLOW (exp)
&& modifier != EXPAND_INITIALIZER)
temp = force_reg (mode, temp);
......
/* Prints out tree in human readable form - GCC
Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
......@@ -115,7 +115,7 @@ print_node_brief (FILE *file, const char *prefix, tree node, int indent)
/* We might as well always print the value of an integer or real. */
if (TREE_CODE (node) == INTEGER_CST)
{
if (TREE_CONSTANT_OVERFLOW (node))
if (TREE_OVERFLOW (node))
fprintf (file, " overflow");
fprintf (file, " ");
......@@ -701,7 +701,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
switch (TREE_CODE (node))
{
case INTEGER_CST:
if (TREE_CONSTANT_OVERFLOW (node))
if (TREE_OVERFLOW (node))
fprintf (file, " overflow");
fprintf (file, " ");
......
/* C-compiler utilities for types and variables storage layout
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1996, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
......@@ -1195,7 +1195,7 @@ place_field (record_layout_info rli, tree field)
if (DECL_SIZE (field) == 0)
/* Do nothing. */;
else if (TREE_CODE (DECL_SIZE (field)) != INTEGER_CST
|| TREE_CONSTANT_OVERFLOW (DECL_SIZE (field)))
|| TREE_OVERFLOW (DECL_SIZE (field)))
{
rli->offset
= size_binop (PLUS_EXPR, rli->offset,
......@@ -1821,7 +1821,7 @@ layout_type (tree type)
&& TREE_CODE (TYPE_SIZE_UNIT (element)) == INTEGER_CST
/* If TYPE_SIZE_UNIT overflowed, then it is certainly larger than
TYPE_ALIGN_UNIT. */
&& !TREE_CONSTANT_OVERFLOW (TYPE_SIZE_UNIT (element))
&& !TREE_OVERFLOW (TYPE_SIZE_UNIT (element))
&& !integer_zerop (TYPE_SIZE_UNIT (element))
&& compare_tree_int (TYPE_SIZE_UNIT (element),
TYPE_ALIGN_UNIT (element)) < 0)
......
/* Chains of recurrences.
Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Sebastian Pop <pop@cri.ensmp.fr>
This file is part of GCC.
......@@ -1293,10 +1293,7 @@ keep_cast:
/* Don't propagate overflows. */
if (CONSTANT_CLASS_P (res))
{
TREE_CONSTANT_OVERFLOW (res) = 0;
TREE_OVERFLOW (res) = 0;
}
TREE_OVERFLOW (res) = 0;
/* But reject constants that don't fit in their type after conversion.
This can happen if TYPE_MIN_VALUE or TYPE_MAX_VALUE are not the
......
/* Language-independent node constructors for parse phase of GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
......@@ -997,7 +997,7 @@ tree
build_vector (tree type, tree vals)
{
tree v = make_node (VECTOR_CST);
int over1 = 0, over2 = 0;
int over = 0;
tree link;
TREE_VECTOR_CST_ELTS (v) = vals;
......@@ -1012,13 +1012,10 @@ build_vector (tree type, tree vals)
if (!CONSTANT_CLASS_P (value))
continue;
over1 |= TREE_OVERFLOW (value);
over2 |= TREE_CONSTANT_OVERFLOW (value);
over |= TREE_OVERFLOW (value);
}
TREE_OVERFLOW (v) = over1;
TREE_CONSTANT_OVERFLOW (v) = over2;
TREE_OVERFLOW (v) = over;
return v;
}
......@@ -1115,7 +1112,7 @@ build_real (tree type, REAL_VALUE_TYPE d)
TREE_TYPE (v) = type;
TREE_REAL_CST_PTR (v) = dp;
TREE_OVERFLOW (v) = TREE_CONSTANT_OVERFLOW (v) = overflow;
TREE_OVERFLOW (v) = overflow;
return v;
}
......@@ -1149,7 +1146,6 @@ build_real_from_int_cst (tree type, tree i)
v = build_real (type, real_value_from_int_cst (type, i));
TREE_OVERFLOW (v) |= overflow;
TREE_CONSTANT_OVERFLOW (v) |= overflow;
return v;
}
......@@ -1198,8 +1194,6 @@ build_complex (tree type, tree real, tree imag)
TREE_IMAGPART (t) = imag;
TREE_TYPE (t) = type ? type : build_complex_type (TREE_TYPE (real));
TREE_OVERFLOW (t) = TREE_OVERFLOW (real) | TREE_OVERFLOW (imag);
TREE_CONSTANT_OVERFLOW (t)
= TREE_CONSTANT_OVERFLOW (real) | TREE_CONSTANT_OVERFLOW (imag);
return t;
}
......
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