]> gcc.gnu.org Git - gcc.git/commitdiff
flow.c (calculate_global_regs_live): Only force stack pointer live before reload.
authorRichard Henderson <rth@redhat.com>
Tue, 5 Dec 2000 07:58:18 +0000 (23:58 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 5 Dec 2000 07:58:18 +0000 (23:58 -0800)
        * flow.c (calculate_global_regs_live): Only force stack pointer
        live before reload.  Force pic register live before reload.
        (insn_dead_p): Don't protect pic references from deletion.

From-SVN: r38027

gcc/ChangeLog
gcc/flow.c

index 575726005ca788e795e7f67875818a8f76f2dfc0..0d55ea845009966aa6ddfda10cb572e07a9444ce 100644 (file)
@@ -1,3 +1,9 @@
+2000-12-05  Richard Henderson  <rth@redhat.com>
+
+       * flow.c (calculate_global_regs_live): Only force stack pointer
+       live before reload.  Force pic register live before reload.
+       (insn_dead_p): Don't protect pic references from deletion.
+
 2000-12-05  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * invoke.texi: Add support for using texi2pod.pl.  Don't use
index 4aacbf8413e2a41a4f7fef241965d6d2e87c6e44..1e51d20038bf604c0bd4c1b6fd94388a226b0863 100644 (file)
@@ -3368,15 +3368,32 @@ calculate_global_regs_live (blocks_in, blocks_out, flags)
          IOR_REG_SET (new_live_at_end, sb->global_live_at_start);
        }
 
-      /* Force the stack pointer to be live -- which might not already be
-        the case for blocks within infinite loops.  */
-      SET_REGNO_REG_SET (new_live_at_end, STACK_POINTER_REGNUM);
-
-      /* Similarly for the frame pointer before reload.  Any reference
-        to any pseudo before reload is a potential reference of the
-        frame pointer.  */
+      /* Before reload, there are a few registers that must be forced
+        live everywhere -- which might not already be the case for 
+        blocks within infinite loops.  */
       if (! reload_completed)
-       SET_REGNO_REG_SET (new_live_at_end, FRAME_POINTER_REGNUM);
+       {
+         /* The all-important stack pointer.  */
+         SET_REGNO_REG_SET (new_live_at_end, STACK_POINTER_REGNUM);
+
+         /* Any reference to any pseudo before reload is a potential
+            reference of the frame pointer.  */
+         SET_REGNO_REG_SET (new_live_at_end, FRAME_POINTER_REGNUM);
+
+#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+         /* Pseudos with argument area equivalences may require
+            reloading via the argument pointer.  */
+         if (fixed_regs[ARG_POINTER_REGNUM])
+           SET_REGNO_REG_SET (new_live_at_end, ARG_POINTER_REGNUM);
+#endif
+
+#ifdef PIC_OFFSET_TABLE_REGNUM
+         /* Any constant, or pseudo with constant equivalences, may
+            require reloading from memory using the pic register.  */
+         if (fixed_regs[PIC_OFFSET_TABLE_REGNUM])
+           SET_REGNO_REG_SET (new_live_at_end, PIC_OFFSET_TABLE_REGNUM);
+#endif
+       }
 
       /* Regs used in phi nodes are not included in
         global_live_at_start, since they are live only along a
@@ -4219,6 +4236,10 @@ insn_dead_p (pbi, x, call_ok, notes)
              if (regno == STACK_POINTER_REGNUM)
                return 0;
 
+             /* ??? These bits might be redundant with the force live bits
+                in calculate_global_regs_live.  We would delete from
+                sequential sets; whether this actually affects real code
+                for anything but the stack pointer I don't know.  */
              /* Make sure insns to set the frame pointer aren't deleted.  */
              if (regno == FRAME_POINTER_REGNUM
                  && (! reload_completed || frame_pointer_needed))
@@ -4237,16 +4258,6 @@ insn_dead_p (pbi, x, call_ok, notes)
                return 0;
 #endif
 
-#ifdef PIC_OFFSET_TABLE_REGNUM
-             /* Before reload, do not allow sets of the pic register
-                to be deleted.  Reload can insert references to
-                constant pool memory anywhere in the function, making
-                the PIC register live where it wasn't before.  */
-             if (regno == PIC_OFFSET_TABLE_REGNUM && fixed_regs[regno]
-                 && ! reload_completed)
-               return 0;
-#endif
-
              /* Otherwise, the set is dead.  */
              return 1;
            }
This page took 0.0828449999999999 seconds and 5 git commands to generate.