public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/53772] New: Failed to combine load and jump on vtable
@ 2012-06-25 21:59 hjl.tools at gmail dot com
  2012-06-26  8:52 ` [Bug target/53772] " jakub at gcc dot gnu.org
  2021-08-19  5:20 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2012-06-25 21:59 UTC (permalink / raw)
  To: gcc-bugs

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]$


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug target/53772] Failed to combine load and jump on vtable
  2012-06-25 21:59 [Bug target/53772] New: Failed to combine load and jump on vtable hjl.tools at gmail dot com
@ 2012-06-26  8:52 ` jakub at gcc dot gnu.org
  2021-08-19  5:20 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-06-26  8:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53772

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-26 08:52:10 UTC ---
This is a sibcall, for which we currently don't allow MEM operands:
;; Similarly, but for tail calls, in which we cannot allow memory references.
(define_special_predicate "sibcall_insn_operand"
  (ior (match_test "constant_call_address_operand
                     (op, mode == VOIDmode ? mode : Pmode)")
       (match_operand 0 "register_no_elim_operand")))
We could allow there MEMs, but only if we can prove the MEM doesn't live on the
stack below the red-zone.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug target/53772] Failed to combine load and jump on vtable
  2012-06-25 21:59 [Bug target/53772] New: Failed to combine load and jump on vtable hjl.tools at gmail dot com
  2012-06-26  8:52 ` [Bug target/53772] " jakub at gcc dot gnu.org
@ 2021-08-19  5:20 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-19  5:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53772

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 5+ with PR 60104.

*** This bug has been marked as a duplicate of bug 60104 ***

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-19  5:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-25 21:59 [Bug target/53772] New: Failed to combine load and jump on vtable hjl.tools at gmail dot com
2012-06-26  8:52 ` [Bug target/53772] " jakub at gcc dot gnu.org
2021-08-19  5:20 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).