From: Mike Stump Date: Wed, 19 Aug 1992 01:33:35 +0000 (+0000) Subject: expr.c (expand_expr): When expanding TARGET_EXPRs... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ac993f4f60fbab216489ac43984ada09b8e4ec5a;p=gcc.git 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 --- diff --git a/gcc/expr.c b/gcc/expr.c index 80018ee4794..d251b3b6773 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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