diff options
author | Mike Stump <mrs@gcc.gnu.org> | 1992-08-19 01:33:35 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 1992-08-19 01:33:35 +0000 |
commit | ac993f4f60fbab216489ac43984ada09b8e4ec5a (patch) | |
tree | 88cf76120497a84f1e8b98ab48a999efcbc690fb /gcc | |
parent | 7e70e7c5a6f10e856effe52c1b6e1e67d2759340 (diff) | |
download | gcc-ac993f4f60fbab216489ac43984ada09b8e4ec5a.zip gcc-ac993f4f60fbab216489ac43984ada09b8e4ec5a.tar.gz gcc-ac993f4f60fbab216489ac43984ada09b8e4ec5a.tar.bz2 |
expr.c (expand_expr): When expanding TARGET_EXPRs...
* expr.c (expand_expr): When expanding TARGET_EXPRs, make sure
that they are only expanded once, after the first expansion,
the rtl can be used without further expansions.
From-SVN: r1890
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/expr.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -4641,7 +4641,12 @@ expand_expr (exp, target, tmode, modifier) if (target == 0) { if (DECL_RTL (slot) != 0) - target = DECL_RTL (slot); + { + target = DECL_RTL (slot); + /* We have already expanded the slot, so don't do + it again. (mrs) */ + return target; + } else { target = assign_stack_temp (mode, int_size_in_bytes (type), 0); @@ -4651,6 +4656,15 @@ expand_expr (exp, target, tmode, modifier) } #if 0 + /* I bet this needs to be done, and I bet that it needs to + be above, inside the else clause. The reason is + simple, how else is it going to get cleaned up? (mrs) + + The reason is probably did not work before, and was + commented out is because this was re-expanding already + expanded target_exprs (target == 0 and DECL_RTL (slot) + != 0) also cleaning them up many times as well. :-( */ + /* Since SLOT is not known to the called function to belong to its stack frame, we must build an explicit cleanup. This case occurs when we must build up a reference |