tree.c (substitute_in_expr): Fix thinko.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 19 May 2008 21:42:48 +0000 (21:42 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 19 May 2008 21:42:48 +0000 (21:42 +0000)
* tree.c (substitute_in_expr) <tcc_vl_exp>: Fix thinko.

From-SVN: r135582

gcc/ChangeLog
gcc/tree.c

index 8ed8a8ad7181e97dea8a7f79a0d341727fc643aa..e9edd794f4d2cdedf1ee9abcf38002695f83ed36 100644 (file)
@@ -1,3 +1,7 @@
+2008-05-19  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * tree.c (substitute_in_expr) <tcc_vl_exp>: Fix thinko.
+
 2008-05-19  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gcc/config/i386/i386.c (ix86_expand_vector_init_concat): Change
index 5a0656c67acb565fa3d6b06708307f455eeff67e..18a9460d063b0c48f0057d8f525f1cb89fb37121 100644 (file)
@@ -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