From patchwork Fri Dec 14 06:25:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 1013358 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-492440-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="njg3X0ha"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SbDKVY5k"; 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 43GLCb6JRKz9s3q for ; Fri, 14 Dec 2018 17:26:00 +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=bGeD7iWx2m+McRS0k6a8/DmrJ6XW8tiwRmCNABLYQx3ZDvpSug TL1d//tFuEuUXy7Irqhv19likXXJnawC7c+ZCqt0aWyinA7jPUrxaWxdfNNCNs6k O1OPw/Bup+SaWvl8IKgye3llMb54ePXPGp09/gnb2QAS4vrIVgBLSHw34= 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=g2FhWMV9QY/WW3tj7vYmLWRZrJg=; b=njg3X0haPqc9veYGsgta mi/C75MerVDIHHQpOOsk5qkuWDol0MAzoqUU0s49ycPMaQDiBZKQOXXKvX+/ooYv gNGb5OgYe1oacbZDtkA0zGqiugLxgC2rt5ni/fWU5qLudngRNQZDpCKqu1yztqHx KgbTJ4kwEMC3sq4MvVok6fc= Received: (qmail 24445 invoked by alias); 14 Dec 2018 06:25:53 -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 23936 invoked by uid 89); 14 Dec 2018 06:25:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-HELO:sk:mail-pl, Hx-spam-relays-external:sk:mail-pl, H*RU:sk:mail-pl X-HELO: mail-pl1-f179.google.com Received: from mail-pl1-f179.google.com (HELO mail-pl1-f179.google.com) (209.85.214.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Dec 2018 06:25:45 +0000 Received: by mail-pl1-f179.google.com with SMTP id u6so2237976plm.8 for ; Thu, 13 Dec 2018 22:25:45 -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=JNy0oZsKT5YnpPp0LAtaYgzEGPvKQQYN4u0fYQwe0Wo=; b=SbDKVY5kWUk2QRpLiYRbyTCR1iilAjuduSwyfXPffu04YtROZb8NeKfC9s5txvSJqt mBDwFGZLpaEG5lmS0qgZUfWYKQl4XDdEYg76NWVutENNlzk/1aZy/YrfvV044AbLX/QR k82ZDmSKe8HZX/hQp8400T2GfjDZobV49ibwqSAz31wCL/iZbsE923OnRkClmXe9uyl4 nNrpnnXl69KTglJ/Uy9S8M4QNRNuZFB4hENkBRWN+RyFigiFwdcZqE/hP5N+96AG9W9c /3l28cPxpgoA2n4Zc983iPCsGlYCg7CGetcA64wevhYL1KOZorXcDKqHWjxsmsqmWWlV l6Wg== Received: from bubble.grove.modra.org ([58.175.241.133]) by smtp.gmail.com with ESMTPSA id w11sm4495575pgk.16.2018.12.13.22.25.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Dec 2018 22:25:42 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id A6D38805F0; Fri, 14 Dec 2018 16:55:37 +1030 (ACDT) Date: Fri, 14 Dec 2018 16:55:37 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [RS6000] PR88311, mlongcall indirections are optimised away Message-ID: <20181214062537.GJ28455@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes Masking CALL_LONG from the cookie was done in order to simplify and correct length attribute calculations for indirect calls at one point in my call series tidy when the indirect patterns used alternatives "0,n" on the cookie operand. (Leaving the CALL_LONG in place calculated the wrong length for long calls without fp args.) This is no longer necessary now that the indirect sysv call patterns explicitly test for the fp arg bits in their length attribute expressions. And without the CALL_LONG to disable insns like call_value_local_svsv, combine merrily replaces the indirect long call sequence with a direct call. As it should. This patch reinstates the CALL_LONG bit. Bootstrapped and regression tested powerpc64le-linux (with HAVE_AS_PLTSEQ) and powerpc64-linux biarch (without HAVE_AS_PLTSEQ). OK? PR rtl-optimization/88311 * config/rs6000/rs6000.c (rs6000_call_sysv): Do not mask cookie. (rs6000_sibcall_sysv): Likewise. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 88f4f620ae4..c4682fce6cd 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -37978,8 +37978,7 @@ rs6000_call_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie) if (value != NULL_RTX) call[0] = gen_rtx_SET (value, call[0]); - unsigned int mask = CALL_V4_SET_FP_ARGS | CALL_V4_CLEAR_FP_ARGS; - call[1] = gen_rtx_USE (VOIDmode, GEN_INT (INTVAL (cookie) & mask)); + call[1] = gen_rtx_USE (VOIDmode, cookie); call[2] = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, LR_REGNO)); insn = gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (3, call)); @@ -38043,8 +38042,7 @@ rs6000_sibcall_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie) if (value != NULL_RTX) call[0] = gen_rtx_SET (value, call[0]); - unsigned int mask = CALL_V4_SET_FP_ARGS | CALL_V4_CLEAR_FP_ARGS; - call[1] = gen_rtx_USE (VOIDmode, GEN_INT (INTVAL (cookie) & mask)); + call[1] = gen_rtx_USE (VOIDmode, cookie); call[2] = simple_return_rtx; insn = gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (3, call));