aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2006-08-25 22:01:28 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2006-08-25 22:01:28 +0000
commit459881189a60e313cbd9e35e415b7cc794289149 (patch)
tree37f57e67d4c17934235b30eed8252327fa14a814 /gcc/fold-const.c
parenta942cc86f86a85fea1342c20091076126c917c34 (diff)
downloadgcc-459881189a60e313cbd9e35e415b7cc794289149.zip
gcc-459881189a60e313cbd9e35e415b7cc794289149.tar.gz
gcc-459881189a60e313cbd9e35e415b7cc794289149.tar.bz2
re PR middle-end/28814 (in compare_values, at tree-vrp.c:415)
2006-08-26 Richard Guenther <rguenther@suse.de> PR middle-end/28814 * fold-const.c (fold_binary): Fold temporary to correct type before constructing new comparison. * gcc.dg/torture/pr28814.c: New testcase. From-SVN: r116439
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 277bd324..69db6c2 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -10289,7 +10289,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
&& 0 != (tem = const_binop (TREE_CODE (arg0) == PLUS_EXPR
? MINUS_EXPR : PLUS_EXPR,
- arg1, TREE_OPERAND (arg0, 1), 0))
+ fold_convert (TREE_TYPE (arg0), arg1),
+ TREE_OPERAND (arg0, 1), 0))
&& ! TREE_CONSTANT_OVERFLOW (tem))
return fold_build2 (code, type, TREE_OPERAND (arg0, 0), tem);