* tree.c (substitute_in_expr, case 4): New case, for ARRAY_REF.

From-SVN: r104271
This commit is contained in:
Eric Botcazou 2005-09-14 15:04:56 +00:00 committed by Eric Botcazou
parent b2d16a23f1
commit 7ad00e1325
2 changed files with 19 additions and 1 deletions

View 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

View 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 ();
}