From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31806 invoked by alias); 21 Dec 2012 09:55:25 -0000 Received: (qmail 31795 invoked by uid 22791); 21 Dec 2012 09:55:25 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Dec 2012 09:55:19 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBL9tEsE003091 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 21 Dec 2012 04:55:19 -0500 Received: from zalov.redhat.com (vpn1-4-118.ams2.redhat.com [10.36.4.118]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBL9t7Yp017875 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Dec 2012 04:55:13 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id qBL9t7ED012331; Fri, 21 Dec 2012 10:55:07 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id qBL9t6YN012330; Fri, 21 Dec 2012 10:55:06 +0100 Date: Fri, 21 Dec 2012 09:55:00 -0000 From: Jakub Jelinek To: Richard Biener Cc: Alexandre Oliva , gcc-patches@gcc.gnu.org, Jan Hubicka Subject: Re: [PR libmudflap/53359] don't register symbols not emitted Message-ID: <20121221095506.GE2315@tucnak.redhat.com> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-12/txt/msg01296.txt.bz2 On Fri, Dec 21, 2012 at 10:50:58AM +0100, 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. > > > > This patch fixes the problem, avoiding registration for symbols that are > > not present in the varpool. > > > > Regstrapped on x86_64-linux-gnu and i686-linux-gnu; I've also verified > > that it removes the TOC references on a ppc64-linux-gnu cross. > > > > Ok to install? > > Hmm, I think that at this point of the compilation you are looking for > TREE_ASM_WRITTEN instead. I'm not sure we will never end up > having a symtab node that not ends up being emitted. Yeah, asan.c also tests TREE_ASM_WRITTEN and doesn't register !TREE_ASM_WRITTEN decls for instrumentation. Jakub