diff options
author | J"orn Rennecke <amylaar@cygnus.co.uk> | 1998-05-01 17:40:53 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 1998-05-01 18:40:53 +0100 |
commit | b60a8416357bb6e8166547bef7bc67c56f104557 (patch) | |
tree | ffd76e0f0eda23e68b7a122b84484b965f5142b4 /gcc/reload.c | |
parent | bd64e40c54cbc7a94acf291e2011346caa637b6e (diff) | |
download | gcc-b60a8416357bb6e8166547bef7bc67c56f104557.zip gcc-b60a8416357bb6e8166547bef7bc67c56f104557.tar.gz gcc-b60a8416357bb6e8166547bef7bc67c56f104557.tar.bz2 |
reload.c (find_reloads): Emit USEs to mark where a pseudo is reloaced with the MEM of its stack slot.
* reload.c (find_reloads): Emit USEs to mark where a pseudo
is reloaced with the MEM of its stack slot.
* reload1.c (cannot_omit_stores): Delete.
(reload): Don't initialize it.
Don't apply avoid_return_reg logic to USEs.
When done, remove USEs that have a REG_EQUAL note on them.
(emit_reload_insns): Handle case where we have inherited a MEM.
(delete_output_reload): Don't use cannot_omit_stores.
From-SVN: r19508
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index 333b1ea..5f02f2c 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -2577,11 +2577,29 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) substed_operand[i] = recog_operand[i] = *recog_operand_loc[i]; } else if (code == SUBREG) - substed_operand[i] = recog_operand[i] = *recog_operand_loc[i] - = find_reloads_toplev (recog_operand[i], i, address_type[i], - ind_levels, - set != 0 - && &SET_DEST (set) == recog_operand_loc[i]); + { + rtx reg = SUBREG_REG (recog_operand[i]); + rtx op + = find_reloads_toplev (recog_operand[i], i, address_type[i], + ind_levels, + set != 0 + && &SET_DEST (set) == recog_operand_loc[i]); + + /* If we made a MEM to load (a part of) the stackslot of a pseudo + that didn't get a hard register, emit a USE with a REG_EQUAL + note in front so that we might inherit a previous, possibly + wider reload. */ + + if (GET_CODE (op) == MEM + && GET_CODE (reg) == REG + && (GET_MODE_SIZE (GET_MODE (reg)) + >= GET_MODE_SIZE (GET_MODE (op)))) + REG_NOTES (emit_insn_before (gen_rtx_USE (VOIDmode, reg), insn)) + = gen_rtx_EXPR_LIST (REG_EQUAL, + reg_equiv_memory_loc[REGNO (reg)], NULL_RTX); + + substed_operand[i] = recog_operand[i] = *recog_operand_loc[i] = op; + } else if (code == PLUS || GET_RTX_CLASS (code) == '1') /* We can get a PLUS as an "operand" as a result of register elimination. See eliminate_regs and gen_reload. We handle @@ -2621,16 +2639,13 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) if (rtx_varies_p (address)) address = copy_rtx (address); - /* If this is an output operand, we must output a CLOBBER - after INSN so find_equiv_reg knows REGNO is being written. - Mark this insn specially, do we can put our output reloads - after it. */ - - if (modified[i] != RELOAD_READ) - PUT_MODE (emit_insn_after (gen_rtx_CLOBBER (VOIDmode, - recog_operand[i]), - insn), - DImode); + /* Emit a USE that shows what register is being used/modified. */ + REG_NOTES (emit_insn_before (gen_rtx_USE (VOIDmode, + recog_operand[i]), + insn)) + = gen_rtx_EXPR_LIST (REG_EQUAL, + reg_equiv_memory_loc[regno], + NULL_RTX); *recog_operand_loc[i] = recog_operand[i] = gen_rtx_MEM (GET_MODE (recog_operand[i]), address); |