This is the mail archive of the
mailing list for the GCC project.
GCC 4.9 generates bigger code for x86
- From: David Guillen Fandos <david at davidgf dot es>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 09 Oct 2014 20:08:34 +0100
- Subject: GCC 4.9 generates bigger code for x86
- Authentication-results: sourceware.org; auth=none
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,