------- Comment #7 from hjl dot tools at gmail dot com  2009-11-20 04:00 -------
(In reply to comment #6)
> 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.

I think the difference comes from DRAP:

  /* Nonzero if function being compiled needs dynamic realigned
     argument pointer (drap) if stack needs realigning.  */
  bool need_drap;

It may be triggered by -mno-accumulate-outgoing-args, alloca,
long jump, ...


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl dot tools at gmail dot
                   |                            |com


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

Reply via email to