From patchwork Mon Jul 13 08:35:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 1327768 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=KEIp8EEj; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B4xmG3DCWz9sDX for ; Mon, 13 Jul 2020 18:35:10 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C81EC388CC2C; Mon, 13 Jul 2020 08:35:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C81EC388CC2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594629307; bh=npagbRcdLKEahEXeUJ2hBcpEM1cvPpORc7Bx7zCupOA=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=KEIp8EEjeazoakOV6zedfcBuJj4DAux/Pmw/o4U1QroDO6eIrIxR9nRKW1JlYKqSZ Ix0g+M5XcNVS4fpEyeZja2nciqZB6+twk+cQWjAk/ljFQB9CbQiyYII6VVwdbllx5G PubAX97PF0/mlFjjbyUHLW8jR+N/D0pYBl4j19Jc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 28502388CC2C for ; Mon, 13 Jul 2020 08:35:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 28502388CC2C IronPort-SDR: yGrwQP+xJY3/8HgfoX/p+yABp0QDoehRp4IK/oF8qZFiKGDQG0PGdMvdo6R/NZePemQXxNe3Ai qyAXWB6QT9nP+pc/jSHZ9Njn0plvu6j0Ar6KzX9q8WISwfoxyZ2Lhh7dEC6wMEmSHoruDv31vj vB7c8KuLugIeRP2RxAhy64ghI4yz089bjVftipLQ93X7yt/WtI21iVgNFLZHQ9/ddu7pxtGi3b WWNdqYSoFuTjJ+/zQufPK9DpgveH1EsB1B43YVQEn0uiMeMOcTJU2aDDpWoze4kkv6yfeEZYBR bL8= X-IronPort-AV: E=Sophos;i="5.75,346,1589234400"; d="scan'208";a="10735940" Date: Mon, 13 Jul 2020 10:35:01 +0200 Message-ID: <202007130835.06D8Z1kv030332@ignucius.se.axis.com> To: Subject: [cris 1/4] cris: Correct output templates in define_subst patterns. MIME-Version: 1.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Whoops. This little gem had the effect of making the output operand (0) constraints disappear but not the input operand (1) constraints for define_subst:ed patterns, probably because there's another (match_dup 1) in the output template (not investigated). That went surprisingly unnoticed until I added a pass leaning just a little bit harder on the define_subst:ed patterns and then only by the libgfortran library generating assembly with nominally incorrect syntax. (There was a move to a special register from a general register, and it incorrectly matched a pattern affecting condition codes.) gcc: * config/cris/cris.md ("setnz_subst", "setnz_subst", "setcc_subst"): Use match_dup in output template, not match_operand. --- gcc/config/cris/cris.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index c36a5402be3..074f5234402 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -275,7 +275,7 @@ (define_subst "setnz_subst" "reload_completed" [(set (reg:CC_NZ CRIS_CC0_REGNUM) (compare:CC_NZ (match_dup 1) (const_int 0))) - (set (match_operand 0) (match_operand 1))]) + (set (match_dup 0) (match_dup 1))]) (define_subst_attr "setnzvc" "setnzvc_subst" "" "_setnzvc") (define_subst_attr "ccnzvc" "setnzvc_subst" "" "_enabled") @@ -288,7 +288,7 @@ (define_subst "setnzvc_subst" "reload_completed" [(set (reg:CC_NZVC CRIS_CC0_REGNUM) (compare:CC_NZVC (match_dup 1) (const_int 0))) - (set (match_operand 0) (match_operand 1))]) + (set (match_dup 0) (match_dup 1))]) (define_subst_attr "setcc" "setcc_subst" "" "_setcc") (define_subst_attr "cccc" "setcc_subst" "" "_enabled") @@ -301,7 +301,7 @@ (define_subst "setcc_subst" "reload_completed" [(set (reg:CC CRIS_CC0_REGNUM) (compare:CC (match_dup 1) (const_int 0))) - (set (match_operand 0) (match_operand 1))]) + (set (match_dup 0) (match_dup 1))]) ;; Operand and operator predicates.