aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@gcc.gnu.org>2002-01-22 02:36:54 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2002-01-22 02:36:54 +0000
commit58dbcf0581d6a91c9374d1087f1e9cd384319121 (patch)
tree6e4bfd5059556e21fa366ff70b7cbead893ee226 /gcc/function.c
parent1ec968465ba6aa66b5aec9aee1b231fc3bb27278 (diff)
downloadgcc-58dbcf0581d6a91c9374d1087f1e9cd384319121.zip
gcc-58dbcf0581d6a91c9374d1087f1e9cd384319121.tar.gz
gcc-58dbcf0581d6a91c9374d1087f1e9cd384319121.tar.bz2
tm.texi: Remove STARTING_FRAME_PHASE.
* doc/tm.texi: Remove STARTING_FRAME_PHASE. * config/rs6000/rs6000.h: Same. * function.c (instantiate_virtual_regs): Remove STARTING_FRAME_PHASE. (assign_stack_local_1): Same. Calculate frame phase. From-SVN: r49063
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/gcc/function.c b/gcc/function.c
index cd39757..bf294ea 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -68,10 +68,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT
#endif
-#ifndef STARTING_FRAME_PHASE
-#define STARTING_FRAME_PHASE 0
-#endif
-
/* Some systems use __main in a way incompatible with its use in gcc, in these
cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
give the same symbol without quotes for an alternative entry point. You
@@ -528,6 +524,7 @@ assign_stack_local_1 (mode, size, align, function)
rtx x, addr;
int bigend_correction = 0;
int alignment;
+ int frame_off, frame_alignment, frame_phase;
if (align == 0)
{
@@ -565,15 +562,21 @@ assign_stack_local_1 (mode, size, align, function)
if (function->stack_alignment_needed < alignment * BITS_PER_UNIT)
function->stack_alignment_needed = alignment * BITS_PER_UNIT;
+ /* Calculate how many bytes the start of local variables is off from
+ stack alignment. */
+ frame_alignment = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
+ frame_off = STARTING_FRAME_OFFSET % frame_alignment;
+ frame_phase = frame_off ? frame_alignment - frame_off : 0;
+
/* Round frame offset to that alignment.
We must be careful here, since FRAME_OFFSET might be negative and
division with a negative dividend isn't as well defined as we might
like. So we instead assume that ALIGNMENT is a power of two and
use logical operations which are unambiguous. */
#ifdef FRAME_GROWS_DOWNWARD
- function->x_frame_offset = FLOOR_ROUND (function->x_frame_offset - STARTING_FRAME_PHASE, alignment) + STARTING_FRAME_PHASE;
+ function->x_frame_offset = FLOOR_ROUND (function->x_frame_offset - frame_phase, alignment) + frame_phase;
#else
- function->x_frame_offset = CEIL_ROUND (function->x_frame_offset - STARTING_FRAME_PHASE, alignment) + STARTING_FRAME_PHASE;
+ function->x_frame_offset = CEIL_ROUND (function->x_frame_offset - frame_phase, alignment) + frame_phase;
#endif
/* On a big-endian machine, if we are allocating more space than we will use,
@@ -3481,21 +3484,6 @@ instantiate_virtual_regs (fndecl, insns)
rtx insn;
unsigned int i;
- if (STARTING_FRAME_PHASE > 0)
- {
- /* Make sure the frame offset and phase displacement are aligned as
- advertised.
-
- Only do the sanity check if we have a STARTING_FRAME_PHASE,
- else we might trigger this abort on ports who claim to have
- STARTING_FRAME_OFFSET aligned properly, but don't. I suppose
- we could enable this and fix those ports. */
-
- if ((STARTING_FRAME_OFFSET + STARTING_FRAME_PHASE)
- % (STACK_BOUNDARY / BITS_PER_UNIT))
- abort ();
- }
-
/* Compute the offsets to use for this function. */
in_arg_offset = FIRST_PARM_OFFSET (fndecl);
var_offset = STARTING_FRAME_OFFSET;