This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Stack alignment
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: geoffk at geoffk dot org (Geoff Keating)
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Feb 2003 18:35:26 -0500 (EST)
- Subject: Re: [PATCH]: Stack alignment
> 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?
I have one additional point. The alignment that reload does aligns
the stack to BIGGEST_ALIGNMENT. This is an alignment suitable for
any local. What the request doesn't do is align the stack to
STACK_BOUNDARY or PREFERRED_STACK_BOUNDARY. If these are larger
than BIGGEST_ALIGNMENT, then the stack won't be properly aligned
unless the backend fixes the alignment.
I am questioning whether it is necessary to align the stack for locals
when there aren't any locals. I am convinced that's not necessary on
the PA due to the way that we align the stack and what happens when
we have no frame. If we have to make STARTING_FRAME_OFFSET a multiple
of BIGGEST_ALIGNMENT / 8 or whatever is needed to ensure that no
alignment occurs, then we have to waste space in every frame.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)