This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52734] Incorrect optimization of uClibc sbrk()
- From: "mikpe at it dot uu.se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Mar 2012 07:45:49 +0000
- Subject: [Bug c/52734] Incorrect optimization of uClibc sbrk()
- Auto-submitted: auto-generated
- References: <bug-52734-4@http.gcc.gnu.org/bugzilla/>
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.