(life_analysis): Mark FP live at end of function.
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 30 Oct 1992 02:55:53 +0000 (21:55 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 30 Oct 1992 02:55:53 +0000 (21:55 -0500)
From-SVN: r2655

gcc/flow.c

index c2f94c96b3263c272d4a2b0ed96f5dda328c99c2..66f0d65d19c7c881ec5d4319230cf43af3923859 100644 (file)
@@ -861,6 +861,20 @@ life_analysis (f, nregs)
            |= (REGSET_ELT_TYPE) 1 << (STACK_POINTER_REGNUM % REGSET_ELT_BITS);
       }
 
+  /* Mark the frame pointer is needed at the end of the function.  If
+     we end up eliminating it, it will be removed from the live list
+     of each basic block by reload.  */
+
+  if (n_basic_blocks > 0)
+    {
+      basic_block_live_at_end[n_basic_blocks - 1]
+       [FRAME_POINTER_REGNUM / REGSET_ELT_BITS]
+         |= (REGSET_ELT_TYPE) 1 << (FRAME_POINTER_REGNUM % REGSET_ELT_BITS);
+      basic_block_new_live_at_end[n_basic_blocks - 1]
+       [FRAME_POINTER_REGNUM / REGSET_ELT_BITS]
+         |= (REGSET_ELT_TYPE) 1 << (FRAME_POINTER_REGNUM % REGSET_ELT_BITS);
+      }
+
   /* Mark all global registers as being live at the end of the function
      since they may be referenced by our caller.  */