From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12459 invoked by alias); 18 Nov 2014 17:17:57 -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 12417 invoked by uid 48); 18 Nov 2014 17:17:53 -0000 From: "rearnsha at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/63874] vtable address generation goes through memory Date: Tue, 18 Nov 2014 17:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: rearnsha at gcc dot gnu.org X-Bugzilla-Status: NEW 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: Message-ID: In-Reply-To: References: 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/msg01751.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63874 --- Comment #1 from Richard Earnshaw --- Sounds like this might be confusion between weak definitions and weak references. If we have a weak reference to the object, we cannot convert it into a pc-relative expression, since that would mean we couldn't detect NULL. However, if we have a non-weak reference to a weak object we can replace that with a pc-relative addressing mode, _provided_ that we can guarantee that the definition will appear in the same link unit (ie it's not part of building a DSO).