This is the mail archive of the gcc@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]

GCC 4.9 generates bigger code for x86


Hi all,

I just noticed that 4.9 generates some code overhead for 386 machines respect to 4.8. In my test case I used 4.8.1 and 4.9.1 and realized that when compiling with "-Os -fno-exceptions -fno-align-functions -fomit-frame-pointer" certain things change:

On 4.9 the backend adds some "nop" after ret or jmp.
It also stops using "leave" instruction, which is really convenient to save some instructions.

It think it is not using leave because of register allocation. In 4.8 a function starts like this:

     390:    55                       push   %ebp
     391:    89 e5                    mov    %esp,%ebp
     393:    53                       push   %ebx

Whereas in 4.9 it starts:

     386:    53                       push   %ebx
     387:    89 cb                    mov    %ecx,%ebx
     389:    83 ec 28                 sub    $0x28,%esp

So the first function actually saves some space.

Any ideas, thoughts, comments?

Thanks a lot,
David G.F.


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