From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62242 invoked by alias); 10 Nov 2015 17:03:13 -0000 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 Received: (qmail 62231 invoked by uid 89); 10 Nov 2015 17:03:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 10 Nov 2015 17:03:11 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id D1BA2935D0 for ; Tue, 10 Nov 2015 17:03:10 +0000 (UTC) Received: from [10.3.232.199] (vpn-232-199.phx2.redhat.com [10.3.232.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAAH3Amr030457; Tue, 10 Nov 2015 12:03:10 -0500 Message-ID: <1447174989.8004.19.camel@surprise> Subject: Re: [PATCH 01/02] PR/62314: add ability to add fixit-hints From: David Malcolm To: Bernd Schmidt Cc: gcc-patches@gcc.gnu.org Date: Tue, 10 Nov 2015 17:03:00 -0000 In-Reply-To: <56421AAA.7030503@redhat.com> References: <1447173325-48683-1-git-send-email-dmalcolm@redhat.com> <56421AAA.7030503@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg01249.txt.bz2 On Tue, 2015-11-10 at 17:26 +0100, Bernd Schmidt wrote: > On 11/10/2015 05:35 PM, David Malcolm wrote: > > + /* Nasty workaround to convince the linker to add > > + rich_location::add_fixit_insert > > + rich_location::add_fixit_remove > > + rich_location::add_fixit_replace > > + to cc1 for use by diagnostic_plugin_test_show_locus, > > + before anything in cc1 is using them. > > + > > + This conditional should never hold, but hopefully the compiler can't > > + figure that out. */ > > Does attribute((used)) help with this problem? For some reason, I'm no longer seeing the problem; I tried simply taking out the kludge, and it now works (this is *without* the in-cc1 usage in patch 2); looking at cc1 shows that the above 3 symbols are indeed being added: $ eu-readelf -s ./cc1 |grep add_fixit 2510: 00000000012a5280 94 FUNC GLOBAL DEFAULT 13 _ZN13rich_location16add_fixit_insertEjPKc 2905: 00000000012a5300 76 FUNC GLOBAL DEFAULT 13 _ZN13rich_location16add_fixit_removeE12source_range 9262: 00000000012a5390 94 FUNC GLOBAL DEFAULT 13 _ZN13rich_location17add_fixit_replaceE12source_rangePKc 37430: 00000000012a5300 76 FUNC GLOBAL DEFAULT 13 _ZN13rich_location16add_fixit_removeE12source_range 46935: 00000000012a5390 94 FUNC GLOBAL DEFAULT 13 _ZN13rich_location17add_fixit_replaceE12source_rangePKc 47508: 00000000012a5280 94 FUNC GLOBAL DEFAULT 13 _ZN13rich_location16add_fixit_insertEjPKc I've tried poking at it, but I'm not sure what changed since I first added the kludge (an earlier version of this, sent as: https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00732.html ); sorry. Dave