------- Comment #3 from bkoz at gcc dot gnu dot org 2008-04-14 22:48 -------
Wow. Confirmed. This does not happen at -O2 with gcc-4.1.2 However, on gcc-4.3.0 branch: $bld/H-x86-gcc-4_3-branch.20080227/bin/g++ -O2 -S -march=i386 testatomic.cc gives: .file "testatomic.cc" .text .p2align 2,,3 .globl main .type main, @function main: .LFB2: leal 4(%esp), %ecx .LCFI0: andl $-16, %esp pushl -4(%ecx) .LCFI1: pushl %ebp .LCFI2: movl %esp, %ebp .LCFI3: pushl %ecx .LCFI4: subl $16, %esp .LCFI5: leal -8(%ebp), %edx xorl %eax, %eax lock addl %eax, (%edx) addl $16, %esp popl %ecx leave leal -4(%ecx), %esp ret .LFE2: .size main, .-main .ident "GCC: (GNU) 4.3.0 20080227 (prerelease)" .section .note.GNU-stack,"",@progbits Fix in progress. -- bkoz at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |bkoz at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2008-04-14 22:48:43 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35816