From patchwork Fri Aug 20 14:43:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 62282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5AB28B70E3 for ; Sat, 21 Aug 2010 00:44:05 +1000 (EST) Received: (qmail 13378 invoked by alias); 20 Aug 2010 14:44:03 -0000 Received: (qmail 13363 invoked by uid 22791); 20 Aug 2010 14:44:02 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_BM X-Spam-Check-By: sourceware.org Received: from mail-pw0-f47.google.com (HELO mail-pw0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Aug 2010 14:43:25 +0000 Received: by pwi9 with SMTP id 9so718061pwi.20 for ; Fri, 20 Aug 2010 07:43:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.161.4 with SMTP id n4mr1039913wfo.208.1282315403716; Fri, 20 Aug 2010 07:43:23 -0700 (PDT) Received: by 10.220.164.142 with HTTP; Fri, 20 Aug 2010 07:43:23 -0700 (PDT) In-Reply-To: References: <20100820115413.GD9926@kam.mff.cuni.cz> Date: Fri, 20 Aug 2010 07:43:23 -0700 Message-ID: Subject: Re: Fix materialization wrt multiple decls with same assembler name From: "H.J. Lu" To: Jan Hubicka Cc: gcc-patches@gcc.gnu.org, rguenther@suse.de, dnovillo@google.com X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Fri, Aug 20, 2010 at 7:36 AM, H.J. Lu wrote: > On Fri, Aug 20, 2010 at 4:54 AM, Jan Hubicka wrote: >> Hi, >> LTO sreaming in is reading in all function that do have corresponding sections >> (based on assebmler name). >> >> This breaks when we have two decls with same assembler name (that is the case >> of bultins). In this case we would attempt to read same body to two different >> declarations that naturally breaks in many interesting ways and thus we test >> DECL_IS_BUILTIN to avoid materialization. >> >> This test is just symptomatic, since it won't work with user aliases and such. >> I am also running into problem with DECL_IS_BUILTIN returning true for all >> compiler born functions since it test locator and UNKNOWN_LOCATION is considred >> to be builtin. >> >> This patch changes lto_materialize_function to work out from callgraph if >> function body is needed instead of checking presence of the section.  This is >> the case when cgraph node is analyzed or when it have such clone. >> >> Bootstrapped/regtested x86_64, testing with mozilla build now, OK? >> >> Honza >> >>        * lto/lto.c (has_analyzed_clone_p): New function >>        (lto_materialize_function): Use callgraph to determine if >>        body is needed. >>        (materialize_cgraph): Remove DECL_IS_BUILTIN check. > > Your checkin is different from you posted and caused: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45357 > I checked in this as an obvious fix. Index: lto.c =================================================================== --- lto.c (revision 163404) +++ lto.c (working copy) @@ -158,7 +158,7 @@ lto_materialize_function (struct cgraph_ decl = node->decl; /* Read in functions with body (analyzed nodes) and also functions that are needed to produce virtual clones. */ - if (node->analyzed || has_analyzed_clone (node)) + if (node->analyzed || has_analyzed_clone_p (node)) { /* This function has a definition. */ TREE_STATIC (decl) = 1; Index: ChangeLog =================================================================== --- ChangeLog (revision 163404) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2010-08-20 H.J. Lu + + PR bootstrap/45357 + * lto.c (lto_materialize_function): Replace has_analyzed_clone + with has_analyzed_clone_p. + 2010-08-20 Jan Hubicka * lto.c (has_analyzed_clone_p): New function