------- Comment #6 from tglx at linutronix dot de  2009-11-20 00:52 -------
I changed the summary to match the real problem.

Further info:

While testing various kernel configs we found out that the problem
comes and goes. Finally I started to compare the gcc command line
options and after some fiddling it turned out that the following
minimal deltas change the code generator behaviour:

Bad:  -march=pentium-mmx                -Wa,-mtune=generic32
Good: -march=i686        -mtune=generic -Wa,-mtune=generic32
Good: -march=pentium-mmx -mtune-generic -Wa,-mtune=generic32

The good ones produce:

650:   55                      push   %ebp
651:   89 e5                   mov    %esp,%ebp
653:   83 e4 f0                and    $0xfffffff0,%esp

The bad one:

000005f0 <timer_stats_update_stats>:
 5f0:   57                      push   %edi
 5f1:   8d 7c 24 08             lea    0x8(%esp),%edi
 5f5:   83 e4 f0                and    $0xfffffff0,%esp
 5f8:   ff 77 fc                pushl  -0x4(%edi)
 5fb:   55                      push   %ebp
 5fc:   89 e5                   mov    %esp,%ebp

It's worse code for no reason and breaks the kernel assumption of ebp + 4 
pointing to the real return address on the stack.


-- 

tglx at linutronix dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|16 byte stack alignment on  |stack alignment happens
                   |random Linux kernel         |_before_ mcount "push %ebp
                   |functions                   |..." depending on -mtune
                   |                            |flags


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42109

Reply via email to