From patchwork Mon Oct 23 17:38:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116840 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4901940qgn; Mon, 23 Oct 2017 10:39:00 -0700 (PDT) X-Received: by 10.159.245.142 with SMTP id a14mr10793906pls.394.1508780340576; Mon, 23 Oct 2017 10:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508780340; cv=none; d=google.com; s=arc-20160816; b=DPp/inskUxtZtc+rR+2JW3EV2P/UKwe9wymw6e0B97oQQrMtcQp11ofVjgtAj5VkbY ZiR5E0lS0jUNTNgSs7wlc90HkoavMQeSHjkO9zh9PNNotgkpJPL9p054Lhd8ypOw5tdS uZM3MerEtsPG+hnjuQoczZRGniM+Ug5Wjh1atAfUwZ6otA1pRw4Y11EBoYcYtTnjiDZX yz0+6y/4wSN39OV+jtVwE0Q3qNpc8tscQgfKd2Lh0fRXm+lIxpEeVsfXtLbETFY1BQfq J0grE7JoEcpHrCQ+QLkpggAh9VIwyq+WnVrkzHypkFhZMtHtba5cxEo+gZb0cCO/WBuX qpFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject: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=2eM5WJFQx9wKo2JViheHgk6/KcbCPg9zVfggBxAuXbs=; b=VNkmoIVYRrcmTjEO5zmcarlhkrQVP+MdevUYUFXU3BYbwwRfZhFAyBiqOEHj+CP5Gv InpgjTrXf4Jkyen2zjxRtwUuLlmryxpOTMMcEh8Ls63Rcx6nKXnh+XbQTOtUSThWWwu2 wxmeiY7WRAYWwDIYalx1yi1X5UL/84Q2nqQ+yJut5NduRK/N9nkIi4foAkAasiadI+M4 t2WOfg/ptJvtnSWZ2ZNf1opcTMnvyuMdnA0c4bYu68w598duNUCM5sCb9QcP9RlA4Nit RnAqnIMbYWnrLfVHPQLlkNFd/LmCi6KwIAZ4xmw//xcwieL0gjm2JWOxMqNaY0TfhgEp zZLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=njl+X4te; spf=pass (google.com: domain of gcc-patches-return-464871-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464871-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 w33si4302404plb.567.2017.10.23.10.39.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 10:39:00 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464871-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=njl+X4te; spf=pass (google.com: domain of gcc-patches-return-464871-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464871-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:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=rvUpjb+fbNEzcqwI/guNABk6L2CRb oURzAZCehsPiHDpEHQ1WzxHQE9rOHR81GxNYlQOvv00XyOrWEwJjVppm/uhCdtX2 ljJH/LgqUtyLH//nI6C51SxgGAwPRzr9ArrWDKlY5sthjhN/sF6dSlJ98PU+F+Ru zIL+9ZikfpUWDw= 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:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=ZxOWqijKCg8lOHlo/x4b2DSUDvY=; b=njl +X4teiTYIdoIduBEKbon4MiUAZO74LDjDBO1EzhaMQKtnwQ7u3AbcVWdc8wmepxl Hm5e4nZy1xbW2HCz3E3I1G0Ms26zcbksjCgT2f/QLDZFiRQxsVaGfTo5IW11Nr/b 8Ri5PawhASnXpJ+uWWuUYcZFTbnTffmJKxbunzQw= Received: (qmail 112527 invoked by alias); 23 Oct 2017 17:38:41 -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 112481 invoked by uid 89); 23 Oct 2017 17:38:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:partial X-HELO: mail-wm0-f49.google.com Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:38:40 +0000 Received: by mail-wm0-f49.google.com with SMTP id p75so11026756wmg.3 for ; Mon, 23 Oct 2017 10:38:39 -0700 (PDT) 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:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=2eM5WJFQx9wKo2JViheHgk6/KcbCPg9zVfggBxAuXbs=; b=ItNfEBBNu8WH0Ctee6dGjPwFmEHEQCBqM+DpBobuOiVJ9vRcrU5KBhKERHMiJZSeCq hMSzQTsXoGcFmbj6O40j0aXuqHcOQfWvYpT1jePdLl+sPLCbVMdhNO0gYZkghzOcHNJo 8DeHaegFPEcF6RLLrt/T682T7Ww6fw0Z5ydd8paAUrgM8hSPxKCKuP1gyKBi9jR6ZMyc IpmgM4yS4UH8/rAAbjUjcL8BH6QQUz6riL1YdANMprhgbr7w1RgNtt5sTORCoStogEQS ldSGblJfMgEv5PDURk27hpVTzeyGOLsAjemTl2AjAriWsJkcAY0zYBsG5ejt+EBKg21C ALgQ== X-Gm-Message-State: AMCzsaVqaciirby5YJUCmqNxHXFNj+ZsXO84wUZW0FBsky8fq5i+QGFN 2nhzAuSD+lDnM8pBgA0G2JTT+tCQpc8= X-Google-Smtp-Source: ABhQp+RRaFJcsbs/HFoXYAPN8/mHDyUwa4UFcxZLDMRBjNeILzbjM+A+tZUSxFH0Yv5sqVkY1V/ZXg== X-Received: by 10.28.29.205 with SMTP id d196mr5454904wmd.106.1508780317816; Mon, 23 Oct 2017 10:38:37 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id w190sm663757wmf.40.2017.10.23.10.38.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:38:36 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [095/nnn] poly_int: process_alt_operands References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 18:38:36 +0100 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87efptepcz.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch makes process_alt_operands check that the mode sizes are ordered, so that match_reload can validly treat them as subregs of one another. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * lra-constraints.c (process_alt_operands): Reject matched operands whose sizes aren't ordered. (match_reload): Refer to this check here. Index: gcc/lra-constraints.c =================================================================== --- gcc/lra-constraints.c 2017-10-23 17:20:47.003797985 +0100 +++ gcc/lra-constraints.c 2017-10-23 17:25:42.597708494 +0100 @@ -933,6 +933,8 @@ match_reload (signed char out, signed ch push_to_sequence (*before); if (inmode != outmode) { + /* process_alt_operands has already checked that the mode sizes + are ordered. */ if (partial_subreg_p (outmode, inmode)) { reg = new_in_reg @@ -2112,6 +2114,13 @@ process_alt_operands (int only_alternati len = 0; lra_assert (nop > m); + /* Reject matches if we don't know which operand is + bigger. This situation would arguably be a bug in + an .md pattern, but could also occur in a user asm. */ + if (!ordered_p (GET_MODE_SIZE (biggest_mode[m]), + GET_MODE_SIZE (biggest_mode[nop]))) + break; + this_alternative_matches = m; m_hregno = get_hard_regno (*curr_id->operand_loc[m], false); /* We are supposed to match a previous operand.