* tree.c (substitute_in_expr, case 4): New case, for ARRAY_REF.
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 14 Sep 2005 15:04:56 +0000 (15:04 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 14 Sep 2005 15:04:56 +0000 (15:04 +0000)
From-SVN: r104271

gcc/ChangeLog
gcc/tree.c

index 191cdc20bca693744c1abfbca9411345b8d3af98..41a1bb32d3dbb4da52f02a637f2502740b23eb62 100644 (file)
@@ -1,3 +1,7 @@
+2005-09-14  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * tree.c (substitute_in_expr, case 4): New case, for ARRAY_REF.
+
 2005-09-14  Uros Bizjak  <uros@kss-loka.si>
 
        PR middle-end/22480
index 2227d8ea64c44b0880ec7f84a8e33163cd35b441..9c4b29ca207a25486623cc5aff8851d57d89d220 100644 (file)
@@ -2180,7 +2180,7 @@ tree
 substitute_in_expr (tree exp, tree f, tree r)
 {
   enum tree_code code = TREE_CODE (exp);
-  tree op0, op1, op2;
+  tree op0, op1, op2, op3;
   tree new;
   tree inner;
 
@@ -2265,6 +2265,20 @@ substitute_in_expr (tree exp, tree f, tree r)
            new = fold_build3 (code, TREE_TYPE (exp), op0, op1, op2);
            break;
 
+         case 4:
+           op0 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 0), f, r);
+           op1 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 1), f, r);
+           op2 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 2), f, r);
+           op3 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 3), f, r);
+
+           if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1)
+               && op2 == TREE_OPERAND (exp, 2)
+               && op3 == TREE_OPERAND (exp, 3))
+             return exp;
+
+           new = fold (build4 (code, TREE_TYPE (exp), op0, op1, op2, op3));
+           break;
+
          default:
            gcc_unreachable ();
          }