From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4828 invoked by alias); 18 Feb 2015 20:49:12 -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 4747 invoked by uid 48); 18 Feb 2015 20:49:08 -0000 From: "law at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/63891] [5 regression] Failure of darwin-weakimport-3.c Date: Wed, 18 Feb 2015 20:49: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: law at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords priority cc 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: 2015-02/txt/msg02057.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63891 Jeffrey A. Law changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|wrong-code | Priority|P1 |P4 CC| |law at redhat dot com --- Comment #6 from Jeffrey A. Law --- AFAICT, this is actually a false positive and mostly points to an inefficiency in our -O0 32-bit PIC code generation on x86. The test wants to make sure that _foo doesn't end up in textcoal_nt section, which is marked with the coalesced section attribute. The test (reasonably so) just blindly looks for the existence of the magic section declaration without any regard to what's in it. In this case we emit PIC setup. It's not strictly necessary as there aren't any uses of the PIC register, but since the optimizer isn't on, DCE is not run and thus the PIC setup remains. Once we have PIC setup, we have the get_pc_thunk routine which gets put into that magic section. Which then triggers the false positive. For darwin-weakimport-3.c, the right fix is probably to turn on -O1. Not sure what the best fix for builtin-self.c is (maybe an xfail), but in both cases this isn't worthy of a P1 regresion. I'd peg it more at a P4/P5 level since the inefficiencies only show up at -O0.