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

[Bug c/52734] Incorrect optimization of uClibc sbrk()


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

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #3 from Mikael Pettersson <mikpe at it dot uu.se> 2012-03-27 07:45:49 UTC ---
Here's the bogus assembly code for ccc() with gcc-4.7 and -Os:

        .globl  ccc
        .type   ccc, @function
ccc:
.LFB1:
        .cfi_startproc
        call    aaa
        testl   %eax, %eax
        je      .L3
.L5:
        movl    bbb(%rip), %eax
        ret
.L3:
        call    aaa
        testl   %eax, %eax
        je      .L5
        xorl    %eax, %eax
        ret
        .cfi_endproc
.LFE1:
        .size   ccc, .-ccc

Note how it fails to read bbb into a local before the second call to aaa.


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