Commit 5c062816 by Mike Stump

expr.c (expand_expr): The first expansion of a TARGET_EXPR is marked by DECL_RTL…

expr.c (expand_expr): The first expansion of a TARGET_EXPR is marked by DECL_RTL (slot) being filled...

        * 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
parent 741be22f
...@@ -4634,6 +4634,7 @@ expand_expr (exp, target, tmode, modifier) ...@@ -4634,6 +4634,7 @@ expand_expr (exp, target, tmode, modifier)
or copied into our original target. */ or copied into our original target. */
tree slot = TREE_OPERAND (exp, 0); tree slot = TREE_OPERAND (exp, 0);
tree exp1;
if (TREE_CODE (slot) != VAR_DECL) if (TREE_CODE (slot) != VAR_DECL)
abort (); abort ();
...@@ -4643,8 +4644,9 @@ expand_expr (exp, target, tmode, modifier) ...@@ -4643,8 +4644,9 @@ expand_expr (exp, target, tmode, modifier)
if (DECL_RTL (slot) != 0) if (DECL_RTL (slot) != 0)
{ {
target = DECL_RTL (slot); 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) */ it again. (mrs) */
if (TREE_OPERAND (exp, 1) == NULL_TREE)
return target; return target;
} }
else else
...@@ -4689,7 +4691,11 @@ expand_expr (exp, target, tmode, modifier) ...@@ -4689,7 +4691,11 @@ expand_expr (exp, target, tmode, modifier)
DECL_RTL (slot) = target; 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: case INIT_EXPR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment