public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/63874] New: vtable address generation goes through memory
Date: Fri, 14 Nov 2014 17:01:00 -0000	[thread overview]
Message-ID: <bug-63874-4@http.gcc.gnu.org/bugzilla/> (raw)

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.


             reply	other threads:[~2014-11-14 17:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-14 17:01 pinskia at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-63874-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).