2005-07-21 James A. Morrison <phython@gcc.gnu.org>
* fold-const.c (fold_unary): Don't strip signed nops from ABS_EXPRs.
(tree_expr_nonnegative_p): Return try for TYPE_UNSIGNED.
From-SVN: r102269
+2005-07-21 James A. Morrison <phython@gcc.gnu.org>
+
+ * fold-const.c (fold_unary): Don't strip signed nops from ABS_EXPRs.
+ (tree_expr_nonnegative_p): Return try for TYPE_UNSIGNED.
+
2005-07-21 DJ Delorie <dj@redhat.com>
* toplev.c (warn_deprecated_use): Add warning control to warning
arg0 = op0;
if (arg0)
{
- if (code == NOP_EXPR || code == FLOAT_EXPR || code == CONVERT_EXPR)
+ if (code == NOP_EXPR || code == CONVERT_EXPR
+ || code == FLOAT_EXPR || code == ABS_EXPR)
{
- /* Don't use STRIP_NOPS, because signedness of argument type matters. */
+ /* Don't use STRIP_NOPS, because signedness of argument type
+ matters. */
STRIP_SIGN_NOPS (arg0);
}
else
int
tree_expr_nonnegative_p (tree t)
{
+ if (TYPE_UNSIGNED (TREE_TYPE (t)))
+ return 1;
+
switch (TREE_CODE (t))
{
case ABS_EXPR: