diff options
author | Mike Stump <mrs@gcc.gnu.org> | 1992-08-19 06:17:27 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 1992-08-19 06:17:27 +0000 |
commit | 5c0628165586764d029e4b762565f2dbdd3eb082 (patch) | |
tree | 1c1692dadd2feef0d77f45f1a35938678d9ae9ac /gcc | |
parent | 741be22fac7f944131ef30b42e55089128c2065b (diff) | |
download | gcc-5c0628165586764d029e4b762565f2dbdd3eb082.zip gcc-5c0628165586764d029e4b762565f2dbdd3eb082.tar.gz gcc-5c0628165586764d029e4b762565f2dbdd3eb082.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/expr.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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: |