From patchwork Sat Dec 3 17:37:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 86432 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp778545qgi; Sat, 3 Dec 2016 09:37:58 -0800 (PST) X-Received: by 10.98.25.205 with SMTP id 196mr50900890pfz.46.1480786678086; Sat, 03 Dec 2016 09:37:58 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 59si9321441plp.46.2016.12.03.09.37.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2016 09:37:58 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-443422-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-443422-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-443422-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=o3UZovq1jgiZ3jWR wDE9vhrOWEaDtKvYesDqww0AlsMlb6Dwj80jUzsjxjKCO2bybG3S9+9zvIdNLOGG SoqJmawOVN1vQiAVgrex0NjuuO6NE9IIxT7wbZUN05khGR6vcy4CrdO4pz1RvzKK sXBia7rpAXmPfx6+F8NkcdCh/yc= 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=gzYpWlfAgv4E8cJ95sRDge 0sHMs=; b=XQy9AEfpAvKwyBN+f0yz/F9zqW9RUcKrMKFFX3rJ6r+c//FnysJSLb wxm9kJKpAeWvnZFTKzP14mFeImAOrgsZA+esIsXnd7hc5KRrK8USHL8chv7rhpqv xPHGTmeq4gf0p18Ii1d9sdUR0G+K8ywBCI8wPKWqIESxqOAFu6bBM= Received: (qmail 109761 invoked by alias); 3 Dec 2016 17:37:46 -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 109708 invoked by uid 89); 3 Dec 2016 17:37:45 -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=SPARC, U*ebotcazou, 243172, ebotcazouadacorecom 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; Sat, 03 Dec 2016 17:37:35 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 6126B81308 for ; Sat, 3 Dec 2016 18:37:33 +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 lF7cXz43LdUF for ; Sat, 3 Dec 2016 18:37:33 +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 3E58481300 for ; Sat, 3 Dec 2016 18:37:33 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Use gen_lowpart_SUBREG consistently in emit_spill_move Date: Sat, 03 Dec 2016 18:37:32 +0100 Message-ID: <3133807.XcagKzxKI3@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-48-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 The second branch of the alternative in emit_spill_move correctly uses gen_lowpart_SUBREG to build a lowpart SUBREG, whereas the first branch uses gen_rtx_SUBREG (..., ..., 0), which of course badly breaks on big-endian. Tested on x86_64/Linux and SPARC/Solaris, applied on the mainline as obvious. 2016-12-03 Eric Botcazou * lra-constraints.c (emit_spill_move): Use gen_lowpart_SUBREG in all cases to build a lowpart SUBREG. -- Eric Botcazou Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 243172) +++ lra-constraints.c (working copy) @@ -1109,9 +1109,9 @@ emit_spill_move (bool to_p, rtx mem_pseu dependent macro HARD_REGNO_CALLER_SAVE_MODE. */ if (! MEM_P (val)) { - val = gen_rtx_SUBREG (GET_MODE (mem_pseudo), - GET_CODE (val) == SUBREG ? SUBREG_REG (val) : val, - 0); + val = gen_lowpart_SUBREG (GET_MODE (mem_pseudo), + GET_CODE (val) == SUBREG + ? SUBREG_REG (val) : val); LRA_SUBREG_P (val) = 1; } else