------- Comment #15 from steven at gcc dot gnu dot org 2010-02-12 21:58 ------- GCC still doesn't get it right for this PR. The .139t.optimized dump for trunk r156706:
;; Function foo (foo) foo () { int a.1; int a.0; <bb 2>: a.0_1 = a; a.1_2 = a.0_1 + 1; a = a.1_2; if (a.1_2 != 0) goto <bb 3>; else goto <bb 4>; <bb 3>: a.1_5 = a.1_2 + 1; a = a.1_5; <bb 4>: return; } Assembly output on ix86 (with -O2 -fomit-frame-pointer): foo: movl a, %edx leal 1(%edx), %eax testl %eax, %eax movl %eax, a je .L1 addl $2, %edx movl %edx, a .L1: rep ret And on x86_64 (-O2): foo: .LFB0: .cfi_startproc movl a(%rip), %edx leal 1(%rdx), %eax testl %eax, %eax movl %eax, a(%rip) je .L1 addl $2, %edx movl %edx, a(%rip) .L1: rep ret .cfi_endproc -- steven at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2008-09-21 13:52:33 |2010-02-12 21:58:52 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12395