@c i'm not sure if the above is still correct.. had to change it to get
@c rid of an overfull. --mew 2feb93
-@findex STARTING_FRAME_PHASE
-@item STARTING_FRAME_PHASE
-This option species how many bytes the frame is out of phase from the
-stack alignment.
-
-For example, some ports assume a stack alignment of 128 bits, but the
-start of the frame is 64 bits displaced from this alignment. In this
-case, you would define @code{STARTING_FRAME_PHASE} to be 8.
-
-This macro defaults to 0, so there is no need to define it if the start
-of the frame maintains the stack alignment.
-
@findex STACK_POINTER_OFFSET
@item STACK_POINTER_OFFSET
Offset from the stack pointer register to the first location at which
#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
rtx x, addr;
int bigend_correction = 0;
int alignment;
+ int frame_off, frame_alignment, frame_phase;
if (align == 0)
{
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,
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;