public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/63874] New: vtable address generation goes through memory
@ 2014-11-14 17:01 pinskia at gcc dot gnu.org
  2014-11-17  9:11 ` [Bug target/63874] " ramana at gcc dot gnu.org
  2014-11-18 17:17 ` rearnsha at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-11-14 17:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63874
           Summary: vtable address generation goes through memory
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
            Target: aarch64

Take:
struct a
{
  virtual void f(void);
  virtual ~a();
};
struct b : a
{
  virtual void f(void);
  virtual ~b();
};
void b::f(void){}
b::~b(void){}

Currently b::~b() produces:
_ZN1bD2Ev:
.LFB2:
    .cfi_startproc
    ldr    x1, .LC0
    str    x1, [x0]
    b    _ZN1aD2Ev
    .cfi_endproc

This really should be:
_ZN1bD2Ev:
.LFB1:
    .cfi_startproc
    adrp    x1, _ZTV1b+16
    add    x1, x1, :lo12:_ZTV1b+16
    str    x1, [x0]
    b    _ZN1aD2Ev

Which is produced if I don't have a definition of b::f() in the same TU causing
the vtable not to be defined weak in this TU.


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

end of thread, other threads:[~2014-11-18 17:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-14 17:01 [Bug target/63874] New: vtable address generation goes through memory pinskia at gcc dot gnu.org
2014-11-17  9:11 ` [Bug target/63874] " ramana at gcc dot gnu.org
2014-11-18 17:17 ` rearnsha 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).