From patchwork Wed Nov 7 05:33:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 994089 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-489200-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="u/XnXyZg"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nVNrmbwj"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42qZpN2TCHz9sC7 for ; Wed, 7 Nov 2018 16:33:45 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=mSrGPfSOV50/I53o2U7ZTWhfMytNf7ZIWhxtJDavOvXB67dpF0 pvx1oDZUQJL4W0QVmeti2Bh0/3OkyNwGxbdJuw4EvJE470xJaA39waYiMJ6853BP 2V7CpUWWHyBaSCMbvD61m/hFAEKqNWDxJP19eSYeLIO1/PswpoZKMgc08= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=YlaMHwhSLpP5LDWN4xz9s1h6CBU=; b=u/XnXyZgcVVtfCVLAbrT yJejzUMCf3Sl2nxKpPfYACz5gOfS+mzbVP2sj/Xizskwyy9FDs6lOHnN1rROpocM 4ade3rUccxhi0Wc0LHDu155XWupGC7T57WY5Od7XVTYl1J8UkgUm9Mo5F0oA6nnl 5OpcXMp/IJ1I5v9z0WNPaVI= Received: (qmail 65793 invoked by alias); 7 Nov 2018 05:33:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 65783 invoked by uid 89); 7 Nov 2018 05:33:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=numerous, dlopen, Hx-languages-length:2259, rs6000c X-HELO: mail-pf1-f173.google.com Received: from mail-pf1-f173.google.com (HELO mail-pf1-f173.google.com) (209.85.210.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Nov 2018 05:33:33 +0000 Received: by mail-pf1-f173.google.com with SMTP id u13-v6so7227156pfm.4 for ; Tue, 06 Nov 2018 21:33:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=gddokPTktBwB4+MU6KgpWDqCFlmu3SM1zsBgz/g+8Sc=; b=nVNrmbwjPPmKg7oR2E84nJEPGrcJQIUGQQnd2gmXlkfVzrsJUvSq5DNLwzT+XMugnB QKpBf0gR+2bM+wrhtV51KqQtxFTDPrC5XUYDN4cVJSVj2p8bgglDDGHdc3E4RVDIJOmV UKopZhy9J76W8dvtBhPNtfCGDNo89aUUU+qvCp8SvRCjyHEzzYaR4Topkyfk+UpCHNVA K61KVOC/8DUxEKqpkHb/MI9F6oWJHU3uhO4+qljJCnttXyPbdiEckouLMuAAiEvnmvRQ 3q5rddt60yKeJ+rscGJwZbK19Fn9xU0Zjkn+3RZx7q3QN4TucFMGRnGcYCkSNVnCmBiG h6NA== Received: from bubble.grove.modra.org ([58.175.241.133]) by smtp.gmail.com with ESMTPSA id w2-v6sm18673508pfn.89.2018.11.06.21.33.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Nov 2018 21:33:30 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id EA2518033C; Wed, 7 Nov 2018 16:03:26 +1030 (ACDT) Date: Wed, 7 Nov 2018 16:03:26 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [PATCH 0/6] [RS6000] inline plt call support Message-ID: <20181107053326.GM29482@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes Hi Segher, This is the patch series you already saw earlier this year, rebased to recent gcc, and with a comment or two fixed. The first five patches tidy and rearrange the function call code in order to support inline plt calls without a huge increase in rs6000.md. As is, inline plt calls are supported for powerpc-linux and powerpc64le-linux ELFv2. I don't support them for powerpc64-linux ELFv1 due to the extra read barriers needed there, but it wouldn't be too difficult to support if there was demand. I've regression tested again on powerpc64le-linux. Earlier testing went to some lengths with old and new binutils on powerpc-linux, powerpc64le-linux and powerpc64-linux. I also tested using -fno-plt in bootstrap and regression tests, which unsurprisingly showed numerous fails due to wrong counts of symbols (inline plt references a function symbol multiple times to make a call), wrong "bl" counts (none with inline call) or similar. I didn't see anything frightening, and I expect that people generally won't regression test with -fno-plt, so I haven't modified any tests. One benefit of the inline plt support is that gcc will now use the new sequences and relocs to support -mlongcall. This allows lazy dynamic resolution of the plt entries so it is now possible to dlopen libraries and have -mlongcall code call functions in those libraries. That wasn't possible before. See https://bugzilla.redhat.com/show_bug.cgi?id=1633721 Alan Modra (6): [RS6000] rs6000_output_call for external call insn assembly output [RS6000] rs6000_output_indirect_call [RS6000] Replace TLSmode with P, and correct tls call mems [RS6000] Remove constraints on call rounded_stack_size_rtx arg [RS6000] Use standard call patterns for __tls_get_addr calls [RS6000] inline plt call sequences gcc/config.in | 6 + gcc/config/rs6000/darwin.md | 8 +- gcc/config/rs6000/predicates.md | 25 + gcc/config/rs6000/rs6000-protos.h | 8 +- gcc/config/rs6000/rs6000.c | 617 ++++++++++++++--- gcc/config/rs6000/rs6000.h | 4 + gcc/config/rs6000/rs6000.md | 1023 +++++++++++++---------------- gcc/configure | 36 + gcc/configure.ac | 6 + 9 files changed, 1065 insertions(+), 668 deletions(-)