From 59e2c378c2f9319e9dea14b09a9d3cdd29d2c0cc Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sun, 7 Aug 1994 08:53:44 -0400 Subject: [PATCH] (eliminate_regs, case SUBREG): Add USE of pseudo so we don't improperly delete an output reload. From-SVN: r7869 --- gcc/reload1.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gcc/reload1.c b/gcc/reload1.c index 6e3c7e57b7a..9223c217553 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -2886,11 +2886,20 @@ eliminate_regs (x, mem_mode, insn) /* If we didn't change anything, we must retain the pseudo. */ if (new == reg_equiv_memory_loc[REGNO (SUBREG_REG (x))]) - new = XEXP (x, 0); + new = SUBREG_REG (x); else - /* Otherwise, ensure NEW isn't shared in case we have to reload - it. */ - new = copy_rtx (new); + { + /* Otherwise, ensure NEW isn't shared in case we have to reload + it. */ + new = copy_rtx (new); + + /* In this case, we must show that the pseudo is used in this + insn so that delete_output_reload will do the right thing. */ + if (insn != 0 && GET_CODE (insn) != EXPR_LIST + && GET_CODE (insn) != INSN_LIST) + emit_insn_before (gen_rtx (USE, VOIDmode, SUBREG_REG (x)), + insn); + } } else new = eliminate_regs (SUBREG_REG (x), mem_mode, insn); -- 2.30.2