aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-02-01 10:27:17 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-02-01 10:27:17 +0000
commitee7d8048d5cb690e325d79e82df75c3ddc36a081 (patch)
tree2371e5f628681bf2c8184df93992ef21f657be0e
parentf1b0882e68c21ec78026a448008a0470244d95b6 (diff)
downloadgcc-ee7d8048d5cb690e325d79e82df75c3ddc36a081.zip
gcc-ee7d8048d5cb690e325d79e82df75c3ddc36a081.tar.gz
gcc-ee7d8048d5cb690e325d79e82df75c3ddc36a081.tar.bz2
re PR middle-end/30656 (ICE with -ftrapv)
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/fold-const.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 56c4ca7..2b6fd69 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index e0cab9c..e3f13e0 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -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;