This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]: Stack alignment


> > Reload aligns the stack in each iteration.  It uses a default alignment
> > value of BIGGEST_ALIGNMENT.  If STARTING_FRAME_OFFSET % BIGGEST_ALIGNMENT
> > is not zero, the rounding in assign_stack_temp_for_type will cause the
> > frame size to be non-zero.  As a result, you will never have a non-empty
> > frame and code for doing the stack adjustments needs to be emitted in
> > the prologue and epilogue.
> 
> Right.  This is because you need to keep the stack aligned, so you can
> never have an empty frame.  Which brings us back to a variant of the
> previous poster's question: is the stack pointer supposed to be
> aligned, or not?

Yes, the stack pointer is supposed to aligned.  Your question
implies that the value specified in STARTING_FRAME_OFFSET affects
the stack alignment.  However, the frame sizes on the PA are
always rounded in compute_frame_size.  The STARTING_FRAME_OFFSET
is just one of a number of items that make up the final frame size.
STARTING_FRAME_OFFSET is not added into the total if the size 
returned by get_frame_size () is zero.  That's why we don't want
assign_stack_local_1 to artificially create a frame.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]