This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Arranging for -Os to imply -mpreferred-stack-boundary=2 on x86
- To: Richard Henderson <rth at redhat dot com>
- Subject: Re: Arranging for -Os to imply -mpreferred-stack-boundary=2 on x86
- From: Geert Bosch <bosch at gnat dot com>
- Date: Wed, 24 Oct 2001 14:38:42 -0400 (EDT)
- Cc: Alexandre Oliva <aoliva at redhat dot com>, gcc-patches at gcc dot gnu dot org
On Wed, 24 Oct 2001, Richard Henderson wrote:
On Tue, Oct 23, 2001 at 07:56:34AM -0200, Alexandre Oliva wrote:
> I'm considering introducing a function attribute to specify the
> alignment requirements of a given function, with similar effects to
> RTH's FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN, so that one can control
> performance-critical (re-)entry points that would benefit from
> additional alignment.
I'd rather detect the required alignment of a function than use
an attribute. Much friendlier when interacting with SSE code
that doesn't just prefer 16 byte alignment, but requires it.
I don't understand exactly what you mean here. If I have two parts of
a program which have been compiled separately, how can we "detect"
the alignment of functions in the other unit? The only information
we have is that from the function declaration.
It seems to me that there are three options for ensuring proper
stack alignment in a function f:
1. maintain an invariant that the stack is aligned at all places
2. have a subset M of functions marked as requiring and maintaining the
aligned stack invariant, and only do alignment in the prologue of f
if f is not in M.
3. assume the stack may be misaligned and do alignment in the prologue of f
Do you mean maybe using the second approach, but determine the set of
functions in M based on the parameter profile?
-Geert