From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106804 invoked by alias); 12 Jan 2017 17:53:28 -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 106794 invoked by uid 89); 12 Jan 2017 17:53:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=Aaron, sawdey, Sawdey, render X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jan 2017 17:53:17 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1cRjYo-0001p5-Cz from joseph_myers@mentor.com ; Thu, 12 Jan 2017 09:53:14 -0800 Received: from digraph.polyomino.org.uk (137.202.0.87) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 12 Jan 2017 17:53:10 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.86_2) (envelope-from ) id 1cRjYg-0008PB-Hd; Thu, 12 Jan 2017 17:53:06 +0000 Date: Thu, 12 Jan 2017 17:53:00 -0000 From: Joseph Myers To: Aaron Sawdey CC: , Segher Boessenkool , David Edelsohn , Bill Schmidt , Tulio Magno Quites Machado Filho Subject: Re: [PATCH] builtin expansion of strncmp for rs6000 In-Reply-To: <1481819465.5501.5.camel@linux.vnet.ibm.com> Message-ID: References: <1481819465.5501.5.camel@linux.vnet.ibm.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2017-01/txt/msg00843.txt.bz2 On Thu, 15 Dec 2016, Aaron Sawdey wrote: > + emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, "strncmp"), > + target, LCT_NORMAL, GET_MODE (target), 3, > + force_reg (Pmode, XEXP (src1, 0)), Pmode, > + force_reg (Pmode, XEXP (src2, 0)), Pmode, > + len_rtx, GET_MODE (len_rtx)); Building glibc with GCC mainline for powerpc64le-linux-gnu (from my bot doing such builds and compilation parts of the testsuite for all GNU/Linux glibc ABIs daily), I'm seeing a failure of the elf/check-localplt test, "Extra PLT reference: libc.so: strncmp". Without having bisected, I suspect this patch of being a likely cause of that failure. glibc redirects internal calls to use hidden aliases such as __GI_strncmp to avoid them going through the PLT. By using gen_rtx_SYMBOL_REF there with a hardcoded function name "strncmp", this code looks like it would render a declaration of strncmp with asm ("__GI_strncmp") ineffective, generating a direct call to strncmp when glibc expects __GI_strncmp to be called instead. I don't know how readily this code can be made to respect asm renaming of strncmp. If it's hard to fix in GCC, I suppose glibc needs a powerpc version of symbol-hacks.h to handle this redirection. -- Joseph S. Myers joseph@codesourcery.com