]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/30656 (ICE with -ftrapv)
authorRichard Guenther <rguenther@suse.de>
Thu, 1 Feb 2007 10:27:17 +0000 (10:27 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 1 Feb 2007 10:27:17 +0000 (10:27 +0000)
2007-02-01  Richard Guenther  <rguenther@suse.de>

PR middle-end/30656
* fold-const.c (fold_negate_expr): Allow negating a
constant if overflow does not change.

From-SVN: r121460

gcc/ChangeLog
gcc/fold-const.c

index 56c4ca79e428361f4c80a41a6f6ab9c10a592435..2b6fd693d3b29b7a69d0d6fde102d97d56bfe15e 100644 (file)
@@ -1,3 +1,9 @@
+2007-02-01  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/30656
+       * fold-const.c (fold_negate_expr): Allow negating a
+       constant if overflow does not change.
+
 2007-02-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * doc/c-tree.texi (Expression trees): Improve markup.
index e0cab9cb889580655c0d5dd00f0446549e3fd61b..e3f13e0fae2ffc089cde4f79ebd051617994a47e 100644 (file)
@@ -1109,7 +1109,7 @@ fold_negate_expr (tree t)
       
     case INTEGER_CST:
       tem = fold_negate_const (t, type);
-      if (!TREE_OVERFLOW (tem)
+      if (TREE_OVERFLOW (tem) == TREE_OVERFLOW (t)
          || !TYPE_OVERFLOW_TRAPS (type))
        return tem;
       break;