From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2293 invoked by alias); 25 Feb 2013 22:27:31 -0000 Received: (qmail 2260 invoked by uid 48); 25 Feb 2013 22:27:14 -0000 From: "thiago at kde dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/56446] [4.6/4.7/4.8 Regression] Generate one fewer relocation when calling a checked weakref function Date: Mon, 25 Feb 2013 22:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: thiago at kde dot 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-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-02/txt/msg02407.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56446 --- Comment #3 from Thiago Macieira 2013-02-25 22:27:14 UTC --- This should not be done for non-PIC code. In those, it might be preferable to make the actual call, as opposed to an indirect jump. I also wonder what would happen for a call that resolves back into the current module. In those cases, keeping the indirect call would be unnecessary. However, it also seems like an edge case to me: why is the symbol weak if it's part of the module?