From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14643 invoked by alias); 25 Jun 2012 21:59:35 -0000 Received: (qmail 14632 invoked by uid 22791); 25 Jun 2012 21:59:35 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_OV 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; Mon, 25 Jun 2012 21:59:22 +0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/53772] New: Failed to combine load and jump on vtable Date: Mon, 25 Jun 2012 21:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com 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: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-06/txt/msg01688.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53772 Bug #: 53772 Summary: Failed to combine load and jump on vtable Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: hjl.tools@gmail.com CC: areg.melikadamyan@gmail.com, ubizjak@gmail.com Target: x86-64 [hjl@gnu-6 tmp]$ cat v.cc struct Foo { virtual void f(); }; void f(Foo *f) { f->f(); } [hjl@gnu-6 tmp]$ /opt/llvm/bin/clang -S -m64 -O2 -o clang64.s v.cc [hjl@gnu-6 tmp]$ cat clang64.s .file "v.cc" .text .globl _Z1fP3Foo .align 16, 0x90 .type _Z1fP3Foo,@function _Z1fP3Foo: # @_Z1fP3Foo .cfi_startproc # BB#0: # %entry movq (%rdi), %rax jmpq *(%rax) # TAILCALL .Ltmp0: .size _Z1fP3Foo, .Ltmp0-_Z1fP3Foo .cfi_endproc .section ".note.GNU-stack","",@progbits [hjl@gnu-6 tmp]$ /usr/gcc-4.7.2-x32/bin/gcc -S -O2 -m64 v.cc -o gcc64.s [hjl@gnu-6 tmp]$ cat gcc64.s .file "v.cc" .text .p2align 4,,15 .globl _Z1fP3Foo .type _Z1fP3Foo, @function _Z1fP3Foo: .LFB0: .cfi_startproc movq (%rdi), %rax movq (%rax), %rax jmp *%rax .cfi_endproc .LFE0: .size _Z1fP3Foo, .-_Z1fP3Foo .ident "GCC: (GNU) 4.7.2 20120622 (prerelease)" .section .note.GNU-stack,"",@progbits [hjl@gnu-6 tmp]$