summaryrefslogtreecommitdiffstats
path: root/gcc/global.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-06-29 20:01:31 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-06-29 20:01:31 +0000
commitd55c71c649a4576fe6cdf89625b13dc98dafd6b6 (patch)
treeca5947c577a6f8e4a5a65698e32477a2fd63954c /gcc/global.c
parenta18a02298ebe953f10b883ecd826c479d36cfd29 (diff)
downloadppe42-gcc-d55c71c649a4576fe6cdf89625b13dc98dafd6b6.tar.gz
ppe42-gcc-d55c71c649a4576fe6cdf89625b13dc98dafd6b6.zip
(global_alloc): Make a more accurate attempt to see if the frame pointer will
be used. If it is, show HARD_FRAME_POINTER_REGNUM used if its not the same as FRAME_POINTER_REGNUM. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7604 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/global.c')
-rw-r--r--gcc/global.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/global.c b/gcc/global.c
index c3dc7493ee5..297e9307b77 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -246,7 +246,7 @@ static struct { int allocno1, allocno2;}
static rtx *regs_set;
static int n_regs_set;
-/* All register that can be eliminated. */
+/* All registers that can be eliminated. */
static HARD_REG_SET eliminable_regset;
@@ -279,6 +279,13 @@ global_alloc (file)
#ifdef ELIMINABLE_REGS
static struct {int from, to; } eliminables[] = ELIMINABLE_REGS;
#endif
+ int need_fp
+ = (! flag_omit_frame_pointer
+#ifdef EXIT_IGNORE_STACK
+ || (current_function_calls_alloca && EXIT_IGNORE_STACK)
+#endif
+ || FRAME_POINTER_REQUIRED);
+
register int i;
rtx x;
@@ -302,20 +309,18 @@ global_alloc (file)
SET_HARD_REG_BIT (eliminable_regset, eliminables[i].from);
if (! CAN_ELIMINATE (eliminables[i].from, eliminables[i].to)
- || (eliminables[i].from == HARD_FRAME_POINTER_REGNUM
- && (! flag_omit_frame_pointer || FRAME_POINTER_REQUIRED)))
+ || (eliminables[i].to == STACK_POINTER_REGNUM && need_fp))
SET_HARD_REG_BIT (no_global_alloc_regs, eliminables[i].from);
}
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- if (!flag_omit_frame_pointer || FRAME_POINTER_REQUIRED)
+ SET_HARD_REG_BIT (eliminable_regset, HARD_FRAME_POINTER_REGNUM);
+ if (need_fp)
SET_HARD_REG_BIT (no_global_alloc_regs, HARD_FRAME_POINTER_REGNUM);
#endif
+
#else
SET_HARD_REG_BIT (eliminable_regset, FRAME_POINTER_REGNUM);
-
- /* If we know we will definitely not be eliminating the frame pointer,
- don't allocate it. */
- if (! flag_omit_frame_pointer || FRAME_POINTER_REQUIRED)
+ if (need_fp)
SET_HARD_REG_BIT (no_global_alloc_regs, FRAME_POINTER_REGNUM);
#endif
OpenPOWER on IntegriCloud