sh.c (sh_expand_prologue): Insns that set up the PIC register may be dead.

* config/sh/sh.c (sh_expand_prologue): Insns that set up the PIC
register may be dead.

From-SVN: r40550
This commit is contained in:
Alexandre Oliva 2001-03-16 12:34:13 +00:00 committed by Alexandre Oliva
parent 91c251fdff
commit fd969c7c33
2 changed files with 22 additions and 1 deletions
gcc
ChangeLog
config/sh

View File

@ -1,3 +1,8 @@
2001-03-16 Alexandre Oliva <aoliva@redhat.com>
* config/sh/sh.c (sh_expand_prologue): Insns that set up the PIC
register may be dead.
2001-03-16 Brad Lucier <lucier@math.purdue.edu>
* Makefile.in (hash.o): Depend on CONFIG_H.

View File

@ -3987,7 +3987,23 @@ sh_expand_prologue ()
push_regs (live_regs_mask, live_regs_mask2);
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
emit_insn (gen_GOTaddr2picreg ());
{
rtx insn = get_last_insn ();
rtx last = emit_insn (gen_GOTaddr2picreg ());
/* Mark these insns as possibly dead. Sometimes, flow2 may
delete all uses of the PIC register. In this case, let it
delete the initialization too. */
do
{
insn = NEXT_INSN (insn);
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD,
const0_rtx,
REG_NOTES (insn));
}
while (insn != last);
}
if (target_flags != save_flags)
{