gcse.c (compute_hash_table): Correctly identify hard regs which are clobbered across calls.

* gcse.c (compute_hash_table): Correctly identify hard regs which are
        clobbered across calls.

From-SVN: r23191
This commit is contained in:
Jeffrey A Law 1998-10-19 23:17:48 +00:00 committed by Jeff Law
parent 18e765cbda
commit 15f8470fd0
2 changed files with 31 additions and 2 deletions

View File

@ -19,6 +19,9 @@ Mon Oct 19 13:26:24 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
Mon Oct 19 11:40:56 1998 Jeffrey A Law (law@cygnus.com)
* gcse.c (compute_hash_table): Correctly identify hard regs which are
clobbered across calls.
* loop.c (scan_loop): Be more selective about what invariants are
moved out of a loop.

View File

@ -2075,7 +2075,20 @@ compute_hash_table (f, set_p)
if (GET_CODE (insn) == CALL_INSN)
{
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (call_used_regs[regno])
if ((call_used_regs[regno]
&& regno != STACK_POINTER_REGNUM
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& regno != HARD_FRAME_POINTER_REGNUM
#endif
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
#endif
#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
&& ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
#endif
&& regno != FRAME_POINTER_REGNUM)
|| global_regs[regno])
record_last_reg_set_info (insn, regno);
if (! CONST_CALL_P (insn))
record_last_mem_set_info (insn);
@ -2548,7 +2561,20 @@ compute_kill_rd ()
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
{
if (call_used_regs[regno])
if ((call_used_regs[regno]
&& regno != STACK_POINTER_REGNUM
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& regno != HARD_FRAME_POINTER_REGNUM
#endif
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (regno == ARG_POINTER_REGNUM
&& fixed_regs[regno])
#endif
#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
&& ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
#endif
&& regno != FRAME_POINTER_REGNUM)
|| global_regs[regno])
handle_rd_kill_set (insn, regno, bb);
}
}