This is the mail archive of the gcc-patches@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: Don't use callgraph to increase preferred_stack_boundary


> On Fri, May 9, 2008 at 12:31 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> > Hi,
> >> Without automatic stack alignment, we can't increase preferred stack boundary.
> >> With automatic stack alignment, it is unnecessary to increase
> >> preferred stack boundary
> >> since unless we can guarantee that all callers will align the outgoing
> >> stack properly,
> >> callee has to align its stack anyway.
> >>
> >> Tested on Linux/ia32 and Linux/Intel64. OK for trunk?
> >
> > On the trunk preferred stack boundary in cgraph should be always at most
> > PREFERRED_STACK_BOUNDARY the variable is initialized to earlier.
> > With automatic stack alignment this should be non-issue.
> > Do you have case where the cgraph's info ends up beaing greater?
> 
> For case like
> 
> void
> foo ()
> {
>   int aligned __attribute__((aligned(64)));
> ...
> }
> 
> void
> bar ()
> {
>   foo ();
> }
> 
> cgraph knows foo needs 64byte alignment and we will
> align outgoing stack of bar to 64byte. But since we don't
> know for sure all callers of foo will align their outgoing stack
> to 64byte, we have to align stack to 64byte in foo. That
> means the stack alignment in bar is unnecessary.

I see, I tought the alignment is cropped to PREFERRED_STACK_BOUNDARY
maximum before stored to callgraph, but that would not help too much
(ie bar would still get extra alignment).

Patch looks OK then.
Honza


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