aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-07-09 19:41:54 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-07-09 19:41:54 +0000
commitb462d62dafaa25a4445191cd1685d2a7c343d1b6 (patch)
tree44874c8e102a8391055f35199a18373413dd8626 /gcc/fold-const.c
parente1cc194c0387dd0ad9fa403429283f89aba293cf (diff)
downloadgcc-b462d62dafaa25a4445191cd1685d2a7c343d1b6.zip
gcc-b462d62dafaa25a4445191cd1685d2a7c343d1b6.tar.gz
gcc-b462d62dafaa25a4445191cd1685d2a7c343d1b6.tar.bz2
re PR tree-optimization/32698 (inefficient pointer expression)
2007-07-09 Richard Guenther <rguenther@suse.de> PR middle-end/32698 * fold-const.c (fold_plusminus_mult_expr): Move constant arguments second to allow decomposing. From-SVN: r126494
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index e69945f..652fd17 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -7122,6 +7122,11 @@ fold_plusminus_mult_expr (enum tree_code code, tree type, tree arg0, tree arg1)
arg00 = TREE_OPERAND (arg0, 0);
arg01 = TREE_OPERAND (arg0, 1);
}
+ else if (TREE_CODE (arg0) == INTEGER_CST)
+ {
+ arg00 = build_one_cst (type);
+ arg01 = arg0;
+ }
else
{
arg00 = arg0;
@@ -7132,6 +7137,11 @@ fold_plusminus_mult_expr (enum tree_code code, tree type, tree arg0, tree arg1)
arg10 = TREE_OPERAND (arg1, 0);
arg11 = TREE_OPERAND (arg1, 1);
}
+ else if (TREE_CODE (arg1) == INTEGER_CST)
+ {
+ arg10 = build_one_cst (type);
+ arg11 = arg1;
+ }
else
{
arg10 = arg1;