From patchwork Fri Jan 26 13:34:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 125973 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp339224ljd; Fri, 26 Jan 2018 05:34:52 -0800 (PST) X-Google-Smtp-Source: AH8x225lnp5fSDIA+KPREsUnPl6GvCgkfrb2Isy/WvpwLAjidyB5cUTd9g5IgaFQuT2tcpPRIHK3 X-Received: by 10.98.57.142 with SMTP id u14mr19201909pfj.237.1516973692184; Fri, 26 Jan 2018 05:34:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516973692; cv=none; d=google.com; s=arc-20160816; b=c9iFhTCJ+GQUyV9pxH3heQotZgb+VQJvE2ZhebULOEyfCPdlitsBjFBzrSnfHbwaEg bPNkZcFMbCOlOFjE6uu1BcRjmFnepD//to+R/KllNrSSe5eFBu2vH+bUQNwWZkNf4Bqy F8CeMFDqPNovMgL+sXjsKpuX0lxKiaYl9ekDY6qg6GfwbVov3BHiSycqisCc5FLkYzy7 AFHPbaj11MQ1f8ALU9nUe90pOAHMCdE8dmyU3KSN8EgwzrcgnKLkrKCP458ZvRteq0bW y11Noq47vSPs64zTRwfqPsihxfzHR0pWlyduxDPVCcuP2g8BrlWNnsBN81Hf1lBltMTc fx/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:date:subject:cc:mail-followup-to :to:from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=Q9RhtnG22Ukzp+niaShHotmirfU2XHsr1SnCgtR2E+I=; b=lBiZCwu+XvoXmSZKYyK0bpKO/boQiPheG8zYhWDfLwiMOc8R2q/Qn0seq/4mLlWyfi Bhr4QeqXVsT6K6wAmE3MiHsa4yS4Sb5uABFhgLmW0JgBg4nzrR1tpKzaRORnGK00fG2c BLQSIB/rQaBTsphaaUEcc0NQqRZyUwiPnWRfAaTvSMhS+5effQjT8kz54tUqCdziZW6R W/s3kBcB4I+lpot01Hn1gbl5VKqwLkcAQLYNWqSDxLSrLIQwM53bE3pew9gFtulvSLBV OdcJLrB/Csb7kjPdAIYdjv7nzP0wGN/Glbw45DYb85zrOeOj/UvLca5Lzy+UJ4tQhCsa H90w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lCK67RCu; spf=pass (google.com: domain of gcc-patches-return-472100-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-472100-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id o12si3038152pgq.9.2018.01.26.05.34.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 05:34:52 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-472100-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 header.s=default header.b=lCK67RCu; spf=pass (google.com: domain of gcc-patches-return-472100-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-472100-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.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:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=jjGM1Bt+Rp4Db8dKXxJm48f0ezOPxtwFKkzg/Lzagq1lDhUeOd p4UHWV/7Tl1i/XuKUhLHI5gkCZ+2nFzciOcXVcYAap988UuphQw6Ak71/kGnYQus 8Orfve3ncR9eygRgF9apVuKn+17lZni5qk73PQ6kww3GjnnnkWfCR8ovM= 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:cc:subject:date:message-id:mime-version:content-type; s= default; bh=zMTjgmekxFCbgpRPKpmaCr1Hea4=; b=lCK67RCuU25JCkK5wUi/ bHqq68XBiOUKGTIMcfkFqTdFF2is6V6326p4NHyhoWJyJR4MNLJ2KKd3Gb/vIUQs EshQcptrx5OiNWjqkR4jYD/3jF06p8Va6skgeSakmE41fBcxVuXzg8YaeJZ08/lf HL5q9f95zdXrg70jzj3+4PA= Received: (qmail 29208 invoked by alias); 26 Jan 2018 13:34:38 -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 29176 invoked by uid 89); 26 Jan 2018 13:34:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=icode, sri X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Jan 2018 13:34:35 +0000 Received: by mail-wm0-f46.google.com with SMTP id 143so1305087wma.5 for ; Fri, 26 Jan 2018 05:34:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:cc:subject:date :message-id:user-agent:mime-version; bh=Q9RhtnG22Ukzp+niaShHotmirfU2XHsr1SnCgtR2E+I=; b=BdVM9o6Yz6oibfqcsLCtHT4UtY8b5LedI7yumaoe4TUzovmRGIMsme5ubML4dfqFVB YfHdRWcp5vpEESAVJBMKRLrj7YAlXWAyJ9xG7p0wFmjYf8k7UlgwI9IlFpTQj/7TITIx aBpO/iJnuKUvSEMett9Hsp10bCi39VuV9VUC1VldhzUTApvjyZD3vEpJ/TJuC0ketoMl 2W7YoRBoTLp8MTUsLNIlMiz9J9fAV/5YFA0TJZJOxKzgCLuFNCx67NfQ+l4R8btGUH96 MIOK7tx8y7N1QkX5Erc/ApIrobe0oE3b8C0rK8Q9T9uoKp0Z/vuNyNdN5lb3kB1BWOOm 1nkg== X-Gm-Message-State: AKwxytfpL9cBDVncAJSpc40si3znL0lKImo+JJ5YdLoOf7eI1s+lCowS l8yiEvuPqr1mTS0MjTbQeVRb2g== X-Received: by 10.28.139.9 with SMTP id n9mr10006171wmd.116.1516973673859; Fri, 26 Jan 2018 05:34:33 -0800 (PST) Received: from localhost (92.40.248.158.threembb.co.uk. [92.40.248.158]) by smtp.gmail.com with ESMTPSA id v75sm8535086wrc.45.2018.01.26.05.34.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jan 2018 05:34:33 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.earnshaw@arm.com, james.greenhalgh@arm.com, marcus.shawcroft@arm.com, richard.sandiford@linaro.org Cc: richard.earnshaw@arm.com, james.greenhalgh@arm.com, marcus.shawcroft@arm.com Subject: [AArch64] Tighten aarch64_secondary_reload condition (PR 83845) Date: Fri, 26 Jan 2018 13:34:31 +0000 Message-ID: <878tckpwuw.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 aarch64_secondary_reload enforced a secondary reload via aarch64_sve_reload_be for memory and pseudo registers, but failed to do the same for subregs of pseudo registers. To avoid this and any similar problems, the patch instead tests for things that the move patterns handle directly; if the operand isn't one of those, we should use the reload pattern instead. The patch fixes an ICE in sve/mask_struct_store_3.c for aarch64_be, where the bogus target description was (rightly) causing LRA to cycle. Tested on aarch64_be-elf and aarch64-linux-gnu. OK to install? Richard 2018-01-26 Richard Sandiford gcc/ PR tearget/83845 * config/aarch64/aarch64.c (aarch64_secondary_reload): Tighten check for operands that need to go through aarch64_sve_reload_be. Index: gcc/config/aarch64/aarch64.c =================================================================== --- gcc/config/aarch64/aarch64.c 2018-01-19 11:57:11.141991997 +0000 +++ gcc/config/aarch64/aarch64.c 2018-01-26 13:32:54.240529011 +0000 @@ -7249,9 +7249,14 @@ aarch64_secondary_reload (bool in_p ATTR machine_mode mode, secondary_reload_info *sri) { + /* Use aarch64_sve_reload_be for SVE reloads that cannot be handled + directly by the *aarch64_sve_mov_be move pattern. See the + comment at the head of aarch64-sve.md for more details about the + big-endian handling. */ if (BYTES_BIG_ENDIAN && reg_class_subset_p (rclass, FP_REGS) - && (MEM_P (x) || (REG_P (x) && !HARD_REGISTER_P (x))) + && !((REG_P (x) && HARD_REGISTER_P (x)) + || aarch64_simd_valid_immediate (x, NULL)) && aarch64_sve_data_mode_p (mode)) { sri->icode = CODE_FOR_aarch64_sve_reload_be;