http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47466
--- Comment #1 from Guillaume Morin <guillaume at morinfr dot org> 2011-01-26 18:26:34 UTC --- A recent 4.6 snapshot shows the same issue .file "foo.cpp" .text .p2align 4,,15 .globl test_expect(EnumStruct const&) .type test_expect(EnumStruct const&), @function test_expect(EnumStruct const&): .LFB4: .cfi_startproc subq $8, %rsp .cfi_def_cfa_offset 16 movsbl (%rdi), %edx xorl %eax, %eax testl %edx, %edx je .L2 cmpl $1, %edx je .L2 call unlikelyCall() movl $1, %eax .L2: addq $8, %rsp .cfi_def_cfa_offset 8 ret .cfi_endproc .LFE4: .size test_expect(EnumStruct const&), .-test_expect(EnumStruct const&) .p2align 4,,15 .globl test_expect2(EnumStruct const&) .type test_expect2(EnumStruct const&), @function test_expect2(EnumStruct const&): .LFB5: .cfi_startproc subq $8, %rsp .cfi_def_cfa_offset 16 movsbl (%rdi), %edx xorl %eax, %eax testl %edx, %edx jne .L10 .L7: addq $8, %rsp .cfi_remember_state .cfi_def_cfa_offset 8 ret .L10: .cfi_restore_state subl $1, %edx je .L7 .p2align 4,,5 call unlikelyCall() movl $1, %eax jmp .L7 .cfi_endproc .LFE5: .size test_expect2(EnumStruct const&), .-test_expect2(EnumStruct const&) .ident "GCC: (Debian 20110116-1) 4.6.0 20110116 (experimental) [trunk revision 168860]" .section .note.GNU-stack,"",@progbits