From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3826 invoked by alias); 5 Aug 2013 14:25:07 -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 3817 invoked by uid 89); 5 Aug 2013 14:25:07 -0000 X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO qmta14.emeryville.ca.mail.comcast.net) (76.96.27.212) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 05 Aug 2013 14:25:06 +0000 Received: from omta21.emeryville.ca.mail.comcast.net ([76.96.30.88]) by qmta14.emeryville.ca.mail.comcast.net with comcast id 92K41m0041u4NiLAE2QyZC; Mon, 05 Aug 2013 14:24:58 +0000 Received: from [IPv6:2601:9:80:2ff:20ae:b5f9:6f0f:68f1] ([IPv6:2601:9:80:2ff:20ae:b5f9:6f0f:68f1]) by omta21.emeryville.ca.mail.comcast.net with comcast id 92Qx1m00M0sVhpS8h2Qya5; Mon, 05 Aug 2013 14:24:58 +0000 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: [PATCH] PR32219, weak hidden reference segfault [PING^2] From: Mike Stump In-Reply-To: <51FFB382.8030902@codesourcery.com> Date: Mon, 05 Aug 2013 14:25:00 -0000 Cc: Diego Novillo , Bernhard Reutner-Fischer , gcc-patches , Nathan Sidwell , , =?windows-1252?Q?Richard_G=FCnther?= , Jeff Law Content-Transfer-Encoding: quoted-printable Message-Id: <405E85EE-7402-452D-8491-241801D2465B@comcast.net> References: <518B71DA.1030302@codesourcery.com> <878v3nt91c.fsf@talisman.default> <51935F65.4000803@codesourcery.com> <87hai4a1ce.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com> <51A85B99.1040102@codesourcery.com> <51C2A8B4.9020302@codesourcery.com> <51E26AA1.7070808@codesourcery.com> <51FE6FDC.2090500@codesourcery.com> <83D3619B-170E-412A-AC78-96DA20AAE671@mrs.kithrup.com> <51FFB382.8030902@codesourcery.com> To: Chung-Lin Tang X-SW-Source: 2013-08/txt/msg00207.txt.bz2 On Aug 5, 2013, at 7:15 AM, Chung-Lin Tang wrote: > On 13/8/5 10:06 PM, Mike Stump wrote: >> On Aug 4, 2013, at 8:14 AM, Chung-Lin Tang wro= te: >>> On 13/7/15 1:43 AM, Diego Novillo wrote: >>>> Could you please repost the patch with its description? This thread >>>> is sufficiently old and noisy that I'm not even sure what the patch >>>> does nor why. >>>=20 >>> Taking the same example in my first post: >>>=20 >>> Under -fPIC, the code in rtlanal.c:nonzero_address_p() does not properly >>> recognize the "PIC-reg + " form of load as a weak symbol; it >>> returns 'true' immediately after seeing the pic-reg indexing, and does >>> not test the wrapped symbol for DECL_WEAK. >>=20 >> So, I can't help but think that others would say that looking into an un= spec is by nature, the wrong way to do it, unless that code is in the port. >>=20 >> I think the followup from Bernhard points to a better solution, though t= he wording in the comment was objectionable. Merely say that the symbol, i= f weak and not defined, is then not local. >=20 > When I last tested that patch which moves the DECL_WEAK check, the > testcases for C++ TLS wrappers fail. I don't remember the fine details, > but effectively it filters out the TLS wrappers from being treated > locally, causing them to be called through @PLT, and regressing on some > tests specifically checking for that=85 Hum=85 I wonder if there is a TLS predicate one can mix in to the check th= at is appropriate. > The UNSPEC interpretation here is fairly restricted, FWIW. Earlier talk > on this thread also mentioned that maybe specific RTL constructs for > reasoning about PIC addresses should be introduced, rather than common > idiomatic pattern, though that may be a long shot for now. specifying the unspecified, make is specified, and calling it unspec, would= seem to be wrong. The right approach, long term, is to have address forms all specified and d= ocumented and a port merely can use the forms they are interested in. pic = is one of those things that should be bumped up, unspec is kinda silly.