aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-08-07 08:53:44 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-08-07 08:53:44 -0400
commit59e2c378c2f9319e9dea14b09a9d3cdd29d2c0cc (patch)
tree0f774a1c4502a34caa4243f328eb4d55b62ee186
parent486d850940b886d03a7be2c525a9cc80f90c669c (diff)
downloadgcc-59e2c378c2f9319e9dea14b09a9d3cdd29d2c0cc.zip
gcc-59e2c378c2f9319e9dea14b09a9d3cdd29d2c0cc.tar.gz
gcc-59e2c378c2f9319e9dea14b09a9d3cdd29d2c0cc.tar.bz2
(eliminate_regs, case SUBREG): Add USE of pseudo so we don't
improperly delete an output reload. From-SVN: r7869
-rw-r--r--gcc/reload1.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 6e3c7e5..9223c21 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);