From: Richard Guenther Date: Thu, 1 Feb 2007 10:27:17 +0000 (+0000) Subject: re PR middle-end/30656 (ICE with -ftrapv) X-Git-Tag: releases/gcc-4.3.0~7107 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee7d8048d5cb690e325d79e82df75c3ddc36a081;p=thirdparty%2Fgcc.git re PR middle-end/30656 (ICE with -ftrapv) 2007-02-01 Richard Guenther PR middle-end/30656 * fold-const.c (fold_negate_expr): Allow negating a constant if overflow does not change. From-SVN: r121460 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 56c4ca79e428..2b6fd693d3b2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-02-01 Richard Guenther + + PR middle-end/30656 + * fold-const.c (fold_negate_expr): Allow negating a + constant if overflow does not change. + 2007-02-01 Ralf Wildenhues * doc/c-tree.texi (Expression trees): Improve markup. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e0cab9cb8895..e3f13e0fae2f 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;