aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-10-19 23:17:48 +0000
committerJeff Law <law@gcc.gnu.org>1998-10-19 17:17:48 -0600
commit15f8470fd056c08d1c0a47417dafb7092b4b0cc2 (patch)
tree5052bd609c1df60e02a325a22e1b34d0d1b5ce7f
parent18e765cbda8f41f36ca36ee219e2d53e3b821fba (diff)
downloadgcc-15f8470fd056c08d1c0a47417dafb7092b4b0cc2.zip
gcc-15f8470fd056c08d1c0a47417dafb7092b4b0cc2.tar.gz
gcc-15f8470fd056c08d1c0a47417dafb7092b4b0cc2.tar.bz2
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
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/gcse.c30
2 files changed, 31 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 85b586d..254788d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 0fdf765..a330fef 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -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);
}
}