This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: BUG: GCC-4.4.x changes the function frame on some functions
- From: Thomas Gleixner <tglx at linutronix dot de>
- To: Linus Torvalds <torvalds at linux-foundation dot org>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, rostedt at goodmis dot org, Ingo Molnar <mingo at elte dot hu>, "H. Peter Anvin" <hpa at zytor dot com>, LKML <linux-kernel at vger dot kernel dot org>, Andrew Morton <akpm at linux-foundation dot org>, Heiko Carstens <heiko dot carstens at de dot ibm dot com>, feng dot tang at intel dot com, Fr??d??ric Weisbecker <fweisbec at gmail dot com>, Peter Zijlstra <peterz at infradead dot org>, jakub at redhat dot com, gcc at gcc dot gnu dot org
- Date: Thu, 19 Nov 2009 21:36:25 +0100 (CET)
- Subject: Re: BUG: GCC-4.4.x changes the function frame on some functions
- References: <alpine.LFD.2.00.0911181933540.24119@localhost.localdomain> <tip-887a29f59b93cf54e21814869a4ab6e80b6fa623@git.kernel.org> <20091119072040.GA23579@elte.hu> <alpine.LFD.2.00.0911191053390.24119@localhost.localdomain> <alpine.LFD.2.00.0911191423190.24119@localhost.localdomain> <alpine.LFD.2.00.0911191607440.24119@localhost.localdomain> <alpine.LFD.2.00.0911190934070.2793@localhost.localdomain> <1258653562.22249.682.camel@gandalf.stny.rr.com> <84fc9c000911191003t244eb864o3d5b355ab5485f@mail.gmail.com> <alpine.LFD.2.00.0911191026420.2793@localhost.localdomain>
On Thu, 19 Nov 2009, Linus Torvalds wrote:
> On Thu, 19 Nov 2009, Richard Guenther wrote:
> >
> > Note that I only can reproduce the issue with
> > -mincoming-stack-boundary=2, not with -mpreferred-stack-boundary=2.
>
> Since you can reproduce it with -mincoming-stack-boundary=2, I woul
> suggest just fixing mcount handling that way regardless of anything else.
> The current code generated by gcc is just insane - even for the case where
> you _want_ 16-byte stack alignment.
>
> Instead crazy code like
>
> > push %edi
> > lea 0x8(%esp),%edi
> > and $0xfffffff0,%esp
> > pushl -0x4(%edi)
> > push %ebp
> > mov %esp,%ebp
> > ...
> > call mcount
>
> the sane thing to do would be to just do it as
>
> push %ebp
> mov %esp,%ebp
> call mcount
> and $0xfffffff0,%esp
which is what the 64bit compile does except that the mcount call
happens a bit later which is fine.
ffffffff8107cd34 <timer_stats_update_stats>:
ffffffff8107cd34: 55 push %rbp
ffffffff8107cd35: 48 89 e5 mov %rsp,%rbp
ffffffff8107cd38: 48 83 e4 c0 and $0xffffffffffffffc0,%rsp
Thanks,
tglx