From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24949 invoked by alias); 26 Jan 2011 18:26:52 -0000 Received: (qmail 24860 invoked by uid 22791); 26 Jan 2011 18:26:51 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_DD X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Jan 2011 18:26:45 +0000 From: "guillaume at morinfr dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/47466] c++ __builtin_expect() regression X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: guillaume at morinfr dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 26 Jan 2011 19:13:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg02870.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47466 --- Comment #1 from Guillaume Morin 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