From patchwork Tue Dec 6 22:47:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 86924 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp34489qgi; Tue, 6 Dec 2016 14:48:06 -0800 (PST) X-Received: by 10.84.195.228 with SMTP id j91mr137715889pld.88.1481064486934; Tue, 06 Dec 2016 14:48:06 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g1si21182509pld.13.2016.12.06.14.48.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 14:48:06 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-443648-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-443648-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-443648-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=SlIF4PQIxfVeV0ol I6itPaD3a1Nom2EDlQS9uRR1QgZW0cD6As1mhym12PTooPcxITtgEnMLKuW1lxoV ojG1ViUQPnRfZBkdFHaaJiX2cAXNLejVpGFgUXRuye6qzDXVpxDoJzVPV743GR8d MSupKmkP9OQpGpwTIxpEmoXoPNs= 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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=nP1oGuf10uL8o99PQAAWjs bcLSM=; b=dW4/Cu9cG9NcK8hE1HwQmNlpwKy9VWRirO9YDZhwCf0W2icLfZhG5z iGP/xJfhZn2jZKRj+ENqBf3jHK1Xv35eD+3Ipfz6JOUQUez5IYQvzvIZiU5CHBLg ivoQMsYk9HYrRBq8z58FJVJuTLA3LFAgfO8vUnTCEWt7W8gPWBN/s= Received: (qmail 50126 invoked by alias); 6 Dec 2016 22:47: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 50049 invoked by uid 89); 6 Dec 2016 22:47:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1810 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Dec 2016 22:47:27 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 2B29E814D1 for ; Tue, 6 Dec 2016 23:47:25 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0dxRXfgBYNFF for ; Tue, 6 Dec 2016 23:47:25 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 07314814CE for ; Tue, 6 Dec 2016 23:47:24 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix PR middle-end/78700 Date: Tue, 06 Dec 2016 23:47:24 +0100 Message-ID: <2209356.jNUR5ZqRd2@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-48-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 The PR is about a couple of regressions in the Go testsuite on PowerPC64/Linux introduced by the patch implementing support for custom descriptors for nested functions. The problematic hunk is the change to expand_call, which moves up the call to prepare_call_address ; this turns out to be problematic because this call can load the static chain register and it now can be clobbered by a call to memcpy used to copy the parameters. The attached patch simply reverts the change, which was not really necessary. Tested on x86-64/Linux, PowerPC64/Linux and SPARC/Solaris, applied as obvious. 2016-12-06 Eric Botcazou PR middle-end/78700 * calls.c (expand_call): Move back call to prepare_call_address. -- Eric Botcazou Index: calls.c =================================================================== --- calls.c (revision 243245) +++ calls.c (working copy) @@ -3427,13 +3427,6 @@ expand_call (tree exp, rtx target, int i if (STRICT_ALIGNMENT) store_unaligned_arguments_into_pseudos (args, num_actuals); - /* Prepare the address of the call. This must be done before any - register parameters is loaded for find_first_parameter_load to - work properly in the presence of descriptors. */ - funexp = prepare_call_address (fndecl ? fndecl : fntype, funexp, - static_chain_value, &call_fusage, - reg_parm_seen, flags); - /* Now store any partially-in-registers parm. This is the last place a block-move can happen. */ if (reg_parm_seen) @@ -3544,6 +3537,9 @@ expand_call (tree exp, rtx target, int i } after_args = get_last_insn (); + funexp = prepare_call_address (fndecl ? fndecl : fntype, funexp, + static_chain_value, &call_fusage, + reg_parm_seen, flags); load_register_parameters (args, num_actuals, &call_fusage, flags, pass == 0, &sibcall_failure);