summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-12-02 15:59:43 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-12-02 15:59:43 +0000
commitf38d3c401b3b964fbe8aabcc3d2dbe3466360e9f (patch)
treea979cbb20495250047456632855733458cfd2e53
parent1e04758d74f8200f256788dc7721a93ae71e39ae (diff)
m88k_layout_frame(): return early if the frame computations have already
been done.
-rw-r--r--gnu/usr.bin/gcc/gcc/config/m88k/m88k.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
index 086dfa9f265..60ce644f4b1 100644
--- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
+++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
@@ -1838,6 +1838,9 @@ m88k_layout_frame ()
{
int regno, sp_size;
+ if (frame_laid_out)
+ return;
+
frame_laid_out = 1;
memset ((char *) &save_regs[0], 0, sizeof (save_regs));
@@ -1854,13 +1857,6 @@ m88k_layout_frame ()
if (write_symbols != NO_DEBUG && !TARGET_OCS_FRAME_POSITION)
save_regs[1] = 1;
- /* If there is a call, or we need a debug frame, r1 needs to be
- saved as well. */
- if (regs_ever_live[1] || frame_pointer_needed)
- {
- save_regs[1] = 1;
- }
-
/* If we are producing PIC, save the addressing base register and r1. */
if (flag_pic && current_function_uses_pic_offset_table)
{
@@ -1874,8 +1870,14 @@ m88k_layout_frame ()
a preserve register. */
if (frame_pointer_needed)
save_regs[FRAME_POINTER_REGNUM] = save_regs[1] = 1;
- else if (regs_ever_live[FRAME_POINTER_REGNUM])
- save_regs[FRAME_POINTER_REGNUM] = 1;
+ else
+ {
+ if (regs_ever_live[FRAME_POINTER_REGNUM])
+ save_regs[FRAME_POINTER_REGNUM] = 1;
+ /* If there is a call, r1 needs to be saved as well. */
+ if (regs_ever_live[1])
+ save_regs[1] = 1;
+ }
/* Figure out which extended register(s) needs to be saved. */
for (regno = FIRST_EXTENDED_REGISTER + 1; regno < FIRST_PSEUDO_REGISTER;
@@ -1938,8 +1940,7 @@ null_prologue ()
{
if (! reload_completed)
return 0;
- if (! frame_laid_out)
- m88k_layout_frame ();
+ m88k_layout_frame ();
return (! frame_pointer_needed
&& nregs == 0
&& nxregs == 0