From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10149 invoked by alias); 2 Jan 2013 14:53:51 -0000 Received: (qmail 10137 invoked by uid 22791); 2 Jan 2013 14:53:50 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-we0-f169.google.com (HELO mail-we0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Jan 2013 14:53:40 +0000 Received: by mail-we0-f169.google.com with SMTP id t49so6998517wey.28 for ; Wed, 02 Jan 2013 06:53:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.39.143 with SMTP id p15mr69914801wik.14.1357138418883; Wed, 02 Jan 2013 06:53:38 -0800 (PST) Received: by 10.194.179.130 with HTTP; Wed, 2 Jan 2013 06:53:38 -0800 (PST) In-Reply-To: References: Date: Wed, 02 Jan 2013 14:53:00 -0000 Message-ID: Subject: Re: [PR libmudflap/53359] don't register symbols not emitted From: Richard Biener To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org, Jan Hubicka Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00042.txt.bz2 On Sun, Dec 30, 2012 at 1:22 AM, Alexandre Oliva wrote: > On Dec 21, 2012, Richard Biener wrote: > >> On Fri, Dec 21, 2012 at 6:33 AM, Alexandre Oliva wrote: >>> libmudflap emits a global initializer that registers memory ranges for >>> global data symbols. However, even if IPA decides not to emit a symbol >>> because it's unused, we'd still emit registration sequences for them in >>> some cases, which, in the PR testcase, would result in TOC references to >>> the undefined symbols. > >> Hmm, I think that at this point of the compilation you are looking for >> TREE_ASM_WRITTEN instead. > > That doesn't work, several mudflap regressions show up because accesses > to global library symbols that are accessed by template methods compiled > with mudflap (say cout) are then verified but not registered. We have > to register symbols that are not emitted but that referenced. Ehm, how can something be not emitted but still referenced? You mean if it's external? So maybe if (!TREE_ASM_WRITTEN (obj) || DECL_EXTERNAL (obj)) instead? Thanks, Richard. > I've now updated the comment to reflect this. > > Is this ok to install? Regstrapped again (along with the patches for > feraiseexcept, since there weren't any non-comment changes here) on > x86_64-linux-gnu and i686-linux-gnu. > > > > > -- > Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ > You must be the change you wish to see in the world. -- Gandhi > Be Free! -- http://FSFLA.org/ FSF Latin America board member > Free Software Evangelist Red Hat Brazil Compiler Engineer >