From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12008 invoked by alias); 14 Nov 2014 17:01:44 -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 Received: (qmail 11444 invoked by uid 48); 14 Nov 2014 17:01:35 -0000 From: "pinskia at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.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-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg01250.txt.bz2 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.