From 3807132684410a5a77915e8ec1f05d0432d45d23 Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Wed, 14 Sep 2005 15:04:56 +0000 Subject: [PATCH] * tree.c (substitute_in_expr, case 4): New case, for ARRAY_REF. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104271 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/tree.c | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 191cdc2..41a1bb3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2005-09-14 Eric Botcazou + + * tree.c (substitute_in_expr, case 4): New case, for ARRAY_REF. + 2005-09-14 Uros Bizjak PR middle-end/22480 diff --git a/gcc/tree.c b/gcc/tree.c index 2227d8e..9c4b29c 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -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 (); } -- 2.7.4