OSDN Git Service

2007-07-09 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 Jul 2007 19:41:54 +0000 (19:41 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 Jul 2007 19:41:54 +0000 (19:41 +0000)
PR middle-end/32698
* fold-const.c (fold_plusminus_mult_expr): Move constant
arguments second to allow decomposing.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126494 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fold-const.c

index 8b3152b..802135b 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2007-07-09  Alexandre Oliva  <aoliva@oliva.athome.lsd.ic.unicamp.br>
 
        Revert:
index e69945f..652fd17 100644 (file)
@@ -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;