aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-05-19 21:42:48 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-05-19 21:42:48 +0000
commitdf8e1fdc2cd3458d025866900bb232fe7afe5ac6 (patch)
tree17641e86b48e5e704541c4d4f59337e76784056c /gcc/tree.c
parent06a5f1ecae0873029a87eb624966143955a853f9 (diff)
downloadgcc-df8e1fdc2cd3458d025866900bb232fe7afe5ac6.zip
gcc-df8e1fdc2cd3458d025866900bb232fe7afe5ac6.tar.gz
gcc-df8e1fdc2cd3458d025866900bb232fe7afe5ac6.tar.bz2
tree.c (substitute_in_expr): Fix thinko.
* tree.c (substitute_in_expr) <tcc_vl_exp>: Fix thinko. From-SVN: r135582
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 5a0656c..18a9460 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2516,8 +2516,7 @@ substitute_in_expr (tree exp, tree f, tree r)
{
enum tree_code code = TREE_CODE (exp);
tree op0, op1, op2, op3;
- tree new;
- tree inner;
+ tree new, inner;
/* We handle TREE_LIST and COMPONENT_REF separately. */
if (code == TREE_LIST)
@@ -2627,13 +2626,15 @@ substitute_in_expr (tree exp, tree f, tree r)
for (i = 1; i < TREE_OPERAND_LENGTH (exp); i++)
{
tree op = TREE_OPERAND (exp, i);
- tree newop = SUBSTITUTE_IN_EXPR (op, f, r);
- if (newop != op)
+ tree new_op = SUBSTITUTE_IN_EXPR (op, f, r);
+ if (new_op != op)
{
- copy = copy_node (exp);
- TREE_OPERAND (copy, i) = newop;
+ if (!copy)
+ copy = copy_node (exp);
+ TREE_OPERAND (copy, i) = new_op;
}
}
+
if (copy)
new = fold (copy);
else