+2007-01-12 Roger Sayle <roger@eyesopen.com>
+
+ * tree.h (force_fit_type_double): Remove unused final argument.
+ * c-common.c (constant_expression_warning): Replace use of
+ TREE_CONSTANT_OVERFLOW with TREE_OVERFLOW.
+ (convert_and_check): Likewise.
+ (shorten_compare): Update call to force_fit_type_double.
+ (c_common_truthvalue_conversion) <INTEGER_CST>: Use integer_zerop.
+ * convert.c (convert_to_pointer): Update call to
+ force_fit_type_double.
+ * fold-const.c (force_fit_type_double): Remove overflowed_const
+ argument.
+ (int_const_binop, fold_convert_const_int_from_int,
+ fold_convert_const_int_from_real, fold_div_compare,
+ fold_sign_changed_comparison, fold_unary, fold_negate_const,
+ fold_abs_const, fold_not_const): Remove the final argument from
+ calls to force_fit_type_double.
+
2007-01-12 Andrew Pinski <andrew_pinski@playstation.sony.com>
* configure.ac: Set insn to "nop" for spu-*-* also.
if ((TREE_CODE (value) == INTEGER_CST || TREE_CODE (value) == REAL_CST
|| TREE_CODE (value) == VECTOR_CST
|| TREE_CODE (value) == COMPLEX_CST)
- && TREE_CONSTANT_OVERFLOW (value)
+ && TREE_OVERFLOW (value)
&& warn_overflow
&& pedantic)
pedwarn ("overflow in constant expression");
/* Do not diagnose overflow in a constant expression merely
because a conversion overflowed. */
if (TREE_OVERFLOW (result))
- {
- TREE_CONSTANT_OVERFLOW (result) = TREE_CONSTANT_OVERFLOW (expr);
- TREE_OVERFLOW (result) = TREE_OVERFLOW (expr);
- }
-
+ TREE_OVERFLOW (result) = TREE_OVERFLOW (expr);
+
if (TYPE_UNSIGNED (type))
{
/* This detects cases like converting -129 or 256 to
primop1 = force_fit_type_double (*restype_ptr,
TREE_INT_CST_LOW (primop1),
TREE_INT_CST_HIGH (primop1), 0,
- TREE_OVERFLOW (primop1),
- TREE_CONSTANT_OVERFLOW (primop1));
+ TREE_OVERFLOW (primop1));
}
if (type != *restype_ptr)
{
return expr;
case INTEGER_CST:
- /* Avoid integer_zerop to ignore TREE_CONSTANT_OVERFLOW. */
- return (TREE_INT_CST_LOW (expr) != 0 || TREE_INT_CST_HIGH (expr) != 0)
- ? truthvalue_true_node
- : truthvalue_false_node;
+ return integer_zerop (expr) ? truthvalue_false_node
+ : truthvalue_true_node;
case REAL_CST:
return real_compare (NE_EXPR, &TREE_REAL_CST (expr), &dconst0)
/* Fold a constant sub-tree into a single node for C-compiler
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ for cross-compilers. */
/* The entry points in this file are fold, size_int_wide, size_binop
- and force_fit_type.
+ and force_fit_type_double.
fold takes a tree as argument and returns a simplified tree.
size_int takes an integer value, and creates a tree constant
with type from `sizetype'.
- force_fit_type takes a constant, an overflowable flag and prior
- overflow indicators. It forces the value to fit the type and sets
- TREE_OVERFLOW as appropriate.
-
+ force_fit_type_double takes a constant, an overflowable flag and a
+ prior overflow indicator. It forces the value to fit the type and
+ sets TREE_OVERFLOW.
+
Note: Since the folders get called on non-gimple code as well as
gimple code, we need to handle GIMPLE tuples as well as their
corresponding tree equivalents. */
tree
force_fit_type_double (tree type, unsigned HOST_WIDE_INT low,
HOST_WIDE_INT high, int overflowable,
- bool overflowed, bool overflowed_const)
+ bool overflowed)
{
int sign_extended_type;
bool overflow;
overflow = fit_double_type (low, high, &low, &high, type);
/* If we need to set overflow flags, return a new unshared node. */
- if (overflowed || overflowed_const || overflow)
+ if (overflowed || overflow)
{
if (overflowed
|| overflowable < 0
else
t = force_fit_type_double (TREE_TYPE (arg1), low, hi, 1,
((!uns || is_sizetype) && overflow)
- | TREE_OVERFLOW (arg1) | TREE_OVERFLOW (arg2),
- false);
+ | TREE_OVERFLOW (arg1) | TREE_OVERFLOW (arg2));
return t;
}
(TREE_INT_CST_HIGH (arg1) < 0
&& (TYPE_UNSIGNED (type)
< TYPE_UNSIGNED (TREE_TYPE (arg1))))
- | TREE_OVERFLOW (arg1),
- false);
+ | TREE_OVERFLOW (arg1));
return t;
}
REAL_VALUE_TO_INT (&low, &high, r);
t = force_fit_type_double (type, low, high, -1,
- overflow | TREE_OVERFLOW (arg1),
- false);
+ overflow | TREE_OVERFLOW (arg1));
return t;
}
TREE_INT_CST_HIGH (arg1),
&lpart, &hpart, unsigned_p);
prod = force_fit_type_double (TREE_TYPE (arg00), lpart, hpart,
- -1, overflow, false);
+ -1, overflow);
neg_overflow = false;
if (unsigned_p)
TREE_INT_CST_HIGH (tmp),
&lpart, &hpart, unsigned_p);
hi = force_fit_type_double (TREE_TYPE (arg00), lpart, hpart,
- -1, overflow | TREE_OVERFLOW (prod),
- false);
+ -1, overflow | TREE_OVERFLOW (prod));
}
else if (tree_int_cst_sgn (arg01) >= 0)
{
if (TREE_CODE (arg1) == INTEGER_CST)
arg1 = force_fit_type_double (inner_type, TREE_INT_CST_LOW (arg1),
TREE_INT_CST_HIGH (arg1), 0,
- TREE_OVERFLOW (arg1),
- false);
+ TREE_OVERFLOW (arg1));
else
arg1 = fold_convert (inner_type, arg1);
{
tem = force_fit_type_double (type, TREE_INT_CST_LOW (and1),
TREE_INT_CST_HIGH (and1), 0,
- TREE_OVERFLOW (and1),
- false);
+ TREE_OVERFLOW (and1));
return fold_build2 (BIT_AND_EXPR, type,
fold_convert (type, and0), tem);
}
&low, &high);
t = force_fit_type_double (type, low, high, 1,
(overflow | TREE_OVERFLOW (arg0))
- && !TYPE_UNSIGNED (type),
- false);
+ && !TYPE_UNSIGNED (type));
break;
}
TREE_INT_CST_HIGH (arg0),
&low, &high);
t = force_fit_type_double (type, low, high, -1,
- overflow | TREE_OVERFLOW (arg0),
- false);
+ overflow | TREE_OVERFLOW (arg0));
}
break;
t = force_fit_type_double (type, ~TREE_INT_CST_LOW (arg0),
~TREE_INT_CST_HIGH (arg0), 0,
- TREE_OVERFLOW (arg0),
- false);
+ TREE_OVERFLOW (arg0));
return t;
}
/* Front-end tree definitions for GNU compiler.
Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
extern tree fold_indirect_ref_1 (tree, tree);
extern tree force_fit_type_double (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- int, bool, bool);
+ int, bool);
extern int fit_double_type (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, tree);