From patchwork Thu Jan 4 18:15:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 123448 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp202532qgn; Thu, 4 Jan 2018 10:16:23 -0800 (PST) X-Google-Smtp-Source: ACJfBouyukkoRodZtjM4L/XOeWTHwTYpBLP7BE4vEhpKpZSG0UQMNiUijYytVWnIkwy2gOojpBVb X-Received: by 10.159.204.130 with SMTP id t2mr389970plo.103.1515089783257; Thu, 04 Jan 2018 10:16:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515089783; cv=none; d=google.com; s=arc-20160816; b=cduRcNmsfj2i3qG7zi5tTikBYaX29ptS9GlN5SqfV+RfRCrUT4sTYVnAOZmjTICFWD +9ZucHG97iyTFAzR+BKMmKhmPY6oVwggYXbvF31FF2TlQTGGwE7teT4omhLqce+sKHFz M0jF3YvIURMcyx4hlTdOcO0efx5OHhofjCitUsc/vg+9ilcYdssJzUZ4/HNEDi+Cigvj VtyWZc2AKV7I2LEgNaNTf+lff4zyPjCrkvjbMcR8MF7je+hcbpzT7Cs1QrWXyaO0v+8t hfXzHnIp341dO05acJzZEm8G1g3OylrrX9SwKEOR2QUGSTlMIj85/fAbFbIehGohzdCR IhpQ== 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=DjaihVTNJS+zST5RBSjoKKiNHszZZRRIZdfa+zDQMag=; b=jOHyw4SRipxv5vYLq8b+B42EUij68Ua2iDDSZnAVpwRGrtvr4iAOejQ0K+Yz6idUCy jVOMisxXwWgAsULZ4rAwDGgf1VUfDYHNqqj9Iqp+gMbxLugnavC0efceX5/GoNdDHMl8 D4kfEOFSHCqKjzFUBDwYmSQr5Pg78Jm1rWpdzLanLelNfvVuF6h237j7SeYekP4DGwSo ucbFaZ77PSBbq9FieTmGRYCmRKFth18Pop1tjv1ByWzxa7bYrM8eyxj8FwdLWI7w6HVf G/Kj9Pp8XuXg+e8qbejAofrv00kO3/aQhXamT93ALqBKICminajsDqeAvfTuqwT0vKIr P0cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=p+lxeeql; spf=pass (google.com: domain of gcc-patches-return-470164-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-470164-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 g4si2342880pgs.673.2018.01.04.10.16.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jan 2018 10:16:23 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-470164-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=p+lxeeql; spf=pass (google.com: domain of gcc-patches-return-470164-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-470164-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=yXdR3XBCwu9cjqAeZTUF6M9kDM51XwlxmzYESvPfaIL9bc42iT c7QkVcvoxfbzDZ6PvvzB0hY0K2KCz1p2B8iPdUmcvqKQKip2k4HdEkakIjRdnhSx x7gHmxpzkU6QXZxSORGtIAuvxHsDFF3PwnDxgBoSaxVfku0qD7ydzRB0o= 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=846Q51b9/fHI104ukY8WF0GWB8k=; b=p+lxeeqlJW8CyX5XWZ+q odyq5rLls/YR9Ytj5RpaYFCFoFmlghPn2C4cH71ax/GQPR8+KYDicGkhy2vfudgn 2T/f7snfbo6It3gdRKThYpU/oLuD93gvEp3afc9z6RrjrIS4gG40BZJYG7FMU1lN syLT+fGAWBppyyD+X2y9AD0= Received: (qmail 55684 invoked by alias); 4 Jan 2018 18:16:10 -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 55640 invoked by uid 89); 4 Jan 2018 18:16:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=spilling X-HELO: mail-wr0-f181.google.com Received: from mail-wr0-f181.google.com (HELO mail-wr0-f181.google.com) (209.85.128.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jan 2018 18:16:02 +0000 Received: by mail-wr0-f181.google.com with SMTP id l41so2295922wre.11 for ; Thu, 04 Jan 2018 10:16:01 -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=DjaihVTNJS+zST5RBSjoKKiNHszZZRRIZdfa+zDQMag=; b=uAIJykUPKHh0gCRlD+ftqhE/ebmKmnD4gBV/BQI9P1j/4zR37KvSBKq9PlvwzuojYA IHC3elSc3+AknqcYn68uNv0YxUYg0AhNnd7f2AALiyazDMX+/GPXPPj7oZSQeVH/WkYP Sh0KrxDIWiy1Ig3EnAGDMXPIeaWCol/LLZeUFBWWTyBMsjv9mN9S7NF0iBguWqwPoPMQ H+G/x5mF6883jtfcKq7uugFRs7/qeJdkQN59LC1wbiHSkmIyKW/YeL7NE49qmLdZUIsk jzlw1EDKJKcI+CU2e+5SHHIufwNFxOb2dpt+QY5y2gbsURquuXwKrZsAdt2Ax3vwYen+ y8gg== X-Gm-Message-State: AKGB3mIErJNAUk7cqx2W26JMvAHipiMq+RlIaWAVONCN/yX5wfPzzmZ5 v6eIi/bTIGWCwC3tbfmxKV+VjbYobJ4= X-Received: by 10.223.130.39 with SMTP id 36mr423115wrb.115.1515089760007; Thu, 04 Jan 2018 10:16:00 -0800 (PST) Received: from localhost ([95.144.14.233]) by smtp.gmail.com with ESMTPSA id m69sm2457591wma.3.2018.01.04.10.15.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jan 2018 10:15:59 -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] Reject (high (const (plus anchor offset))) Date: Thu, 04 Jan 2018 18:15:58 +0000 Message-ID: <87608ha3s1.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 The aarch64_legitimate_constant_p tests for HIGH and CONST seem to be the wrong way round: (high (const ...)) is valid rtl that could be passed in, but (const (high ...)) isn't. As it stands, we disallow anchor+offset but allow (high anchor+offset). TBH I can't remember whether this caused a test failure or if it was just something I noticed by inspection. Either way, the SVE port adds more invalid (const ...)s and it doesn't make sense to test for them before peeling the HIGH. Tested on aarch64-linux-gnu. OK to install? Richard 2018-01-04 Richard Sandiford gcc/ * config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix order of HIGH and CONST checks. Index: gcc/config/aarch64/aarch64.c =================================================================== --- gcc/config/aarch64/aarch64.c 2018-01-03 21:43:30.290452983 +0000 +++ gcc/config/aarch64/aarch64.c 2018-01-04 18:11:30.299730142 +0000 @@ -10449,6 +10449,9 @@ aarch64_legitimate_constant_p (machine_m if (CONST_WIDE_INT_P (x)) return false; + if (GET_CODE (x) == HIGH) + x = XEXP (x, 0); + /* Do not allow const (plus (anchor_symbol, const_int)). */ if (GET_CODE (x) == CONST) { @@ -10460,9 +10463,6 @@ aarch64_legitimate_constant_p (machine_m return false; } - if (GET_CODE (x) == HIGH) - x = XEXP (x, 0); - /* Treat symbols as constants. Avoid TLS symbols as they are complex, so spilling them is better than rematerialization. */ if (SYMBOL_REF_P (x) && !SYMBOL_REF_TLS_MODEL (x))