expr.c (expand_expr): The first expansion of a TARGET_EXPR is marked by DECL_RTL...
authorMike Stump <mrs@gcc.gnu.org>
Wed, 19 Aug 1992 06:17:27 +0000 (06:17 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Wed, 19 Aug 1992 06:17:27 +0000 (06:17 +0000)
        * expr.c (expand_expr): The first expansion of a TARGET_EXPR
        is marked by DECL_RTL (slot) being filled in AND TREE_OPERAND
        (exp, 1) being wiped-out with a NULL_TREE, not just the
        DECL_RTL (slot) being filled in.

From-SVN: r1893

gcc/expr.c

index d251b3b677333f067d22e9419c75e8a111434a35..315474d835f17bb0347cd4cddb07096feca867a7 100644 (file)
@@ -4634,6 +4634,7 @@ expand_expr (exp, target, tmode, modifier)
           or copied into our original target.  */
 
        tree slot = TREE_OPERAND (exp, 0);
+       tree exp1;
 
        if (TREE_CODE (slot) != VAR_DECL)
          abort ();
@@ -4643,9 +4644,10 @@ expand_expr (exp, target, tmode, modifier)
            if (DECL_RTL (slot) != 0)
              {
                target = DECL_RTL (slot);
-               /* We have already expanded the slot, so don't do
+               /* If we have already expanded the slot, so don't do
                   it again.  (mrs)  */
-               return target;
+               if (TREE_OPERAND (exp, 1) == NULL_TREE)
+                 return target;
              }
            else
              {
@@ -4689,7 +4691,11 @@ expand_expr (exp, target, tmode, modifier)
            DECL_RTL (slot) = target;
          }
 
-       return expand_expr (TREE_OPERAND (exp, 1), target, tmode, modifier);
+       exp1 = TREE_OPERAND (exp, 1);
+       /* Mark it as expanded.  */
+       TREE_OPERAND (exp, 1) = NULL_TREE;
+
+       return expand_expr (exp1, target, tmode, modifier);
       }
 
     case INIT_EXPR: