From: Eric Botcazou Date: Mon, 19 May 2008 22:24:38 +0000 (+0000) Subject: tree.c (substitute_placeholder_in_expr) : Minor tweak. X-Git-Tag: releases/gcc-4.4.0~4860 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa74fa3941a3132cb677f6c5ff02634c5e9dd63e;p=thirdparty%2Fgcc.git tree.c (substitute_placeholder_in_expr) : Minor tweak. From-SVN: r135591 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 603f5f6db661..b54350e503fd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,7 @@ 2008-05-19 Eric Botcazou * tree.c (substitute_in_expr) : Fix thinko. + (substitute_placeholder_in_expr) : Minor tweak. 2008-05-19 H.J. Lu diff --git a/gcc/tree.c b/gcc/tree.c index 18a9460d063b..51eba929ff52 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -2778,18 +2778,19 @@ substitute_placeholder_in_expr (tree exp, tree obj) { tree copy = NULL_TREE; int i; - int n = TREE_OPERAND_LENGTH (exp); - for (i = 1; i < n; i++) + + for (i = 1; i < TREE_OPERAND_LENGTH (exp); i++) { tree op = TREE_OPERAND (exp, i); - tree newop = SUBSTITUTE_PLACEHOLDER_IN_EXPR (op, obj); - if (newop != op) + tree new_op = SUBSTITUTE_PLACEHOLDER_IN_EXPR (op, obj); + if (new_op != op) { if (!copy) copy = copy_node (exp); - TREE_OPERAND (copy, i) = newop; + TREE_OPERAND (copy, i) = new_op; } } + if (copy) return fold (copy); else