summaryrefslogtreecommitdiff
path: root/gcc/reload1.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-08-26 10:56:53 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-08-26 10:56:53 +0000
commitfa9351eebb7ec37a3426954c93e0d40a6dbce2c6 (patch)
tree3cce62cd492b1a367d56263c40c5907090c3f449 /gcc/reload1.c
parent50fad108e70c4b9a4334bb7891b882a06d55a3f1 (diff)
downloadgcc-fa9351eebb7ec37a3426954c93e0d40a6dbce2c6.tar.gz
(emit_reload_insns): Do nothing for SUBREG whose operand is unused
subsequently. In secondary reload case, if paradoxical SUBREG for output, reload thing inside SUBREG, just like gen_reload. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@10284 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r--gcc/reload1.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 03ade38203d..5343e2d07a0 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -6259,6 +6259,16 @@ emit_reload_insns (insn)
XEXP (note, 0) = reload_reg_rtx[j];
continue;
}
+ /* Likewise for a SUBREG of an operand that dies. */
+ else if (GET_CODE (old) == SUBREG
+ && GET_CODE (SUBREG_REG (old)) == REG
+ && 0 != (note = find_reg_note (insn, REG_UNUSED,
+ SUBREG_REG (old))))
+ {
+ XEXP (note, 0) = gen_lowpart_common (GET_MODE (old),
+ reload_reg_rtx[j]);
+ continue;
+ }
else if (GET_CODE (old) == SCRATCH)
/* If we aren't optimizing, there won't be a REG_UNUSED note,
but we don't want to make an output reload. */
@@ -6344,11 +6354,23 @@ emit_reload_insns (insn)
{
rtx third_reloadreg
= reload_reg_rtx[reload_secondary_out_reload[secondary_reload]];
+ rtx tem;
/* Copy primary reload reg to secondary reload reg.
(Note that these have been swapped above, then
secondary reload reg to OLD using our insn. */
+ /* If REAL_OLD is a paradoxical SUBREG, remove it
+ and try to put the opposite SUBREG on
+ RELOADREG. */
+ if (GET_CODE (real_old) == SUBREG
+ && (GET_MODE_SIZE (GET_MODE (real_old))
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (real_old))))
+ && 0 != (tem = gen_lowpart_common
+ (GET_MODE (SUBREG_REG (real_old)),
+ reloadreg)))
+ real_old = SUBREG_REG (real_old), reloadreg = tem;
+
gen_reload (reloadreg, second_reloadreg,
reload_opnum[j], reload_when_needed[j]);
emit_insn ((GEN_FCN (tertiary_icode)