OSDN Git Service

* gcse.c (compute_hash_table): Correctly identify hard regs which are
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Oct 1998 23:17:48 +0000 (23:17 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Oct 1998 23:17:48 +0000 (23:17 +0000)
        clobbered across calls.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23191 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gcse.c

index 85b586d..254788d 100644 (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)
 
 
 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.
 
        * loop.c (scan_loop): Be more selective about what invariants are
        moved out of a loop.
 
index 0fdf765..a330fef 100644 (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 (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);
                  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++)
                     {
 
                  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);
                     }
                 }
                        handle_rd_kill_set (insn, regno, bb);
                     }
                 }