From patchwork Wed May 17 09:03:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jin Ma X-Patchwork-Id: 95105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp984305vqo; Wed, 17 May 2023 02:04:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ggZH0K32aQjnxyfUamRAuJh9I2L6rLx/J2EVYh564n3gkQoiQcAJ6bfp1Q4QeYeWiIm7C X-Received: by 2002:aa7:cc95:0:b0:504:e9cc:de35 with SMTP id p21-20020aa7cc95000000b00504e9ccde35mr1593632edt.0.1684314269117; Wed, 17 May 2023 02:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684314269; cv=none; d=google.com; s=arc-20160816; b=rbvrTFX3hldgw8Uw7IK1L9qAPsT48BpWeFlEPSCISU/447+xIBe2cZrztvH34WjBGo 7ploLRBNAlWiU4nzD9i9uw7M37YTRh8kl+1W5FQ/vVbUSIAcx0HDzaHtLnwFyC/uNqte eotZ1EchMAWvSSLoanjBRvuXNs2oQRjb4qZXnlhHwYXOGYXIfHvApOXCyOSuP7rqio50 rMqSSlETG0sH8cExYwgMi8HeEFykBpk4owPfXNIfiylUZriIw4bej8VEXl+lB4eU3V/P 4aBlr2HMypLTWUVPHNPsZP7+IswzV5NOHq605e35uOnBVJsPvD1EZ5Ptwxxf3gCDhsbx U01g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=laCnhH9AhA/mgRPW4gJ60I41oq1snUNBcWtGxg8OuDE=; b=kG/DPCU7QjLCZpYsYTSaBflujT5rD9BlSZ0G7TAhzKKynAr7/ayMnykNgZp+nIfJSd cXDng7ShRprcT4P5x2RCSwgNPNx1RAIiYKOclE/kSc1CHQtgECB/LNbWitEbgIhFeCFW e/Yv75DJ+ViKXD5My3er4q5pTMo1++srwHFLX4k96HyYw9HwlbrrBmpSMv4rsV898CIF 0TDapmbN9EMFaS1lmbqncQI6nacZLqZAqd5SQpdq5mMzRakIFw9WCWvM201hjJOcGA7N 9ewVb9ZOO81m6YS6rhaJlI1ApK/WBehF+79b/5BtXoMu2gUqhG7Mj8FPtsSh14Z1Ojd/ Vz+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=BSbhT5Lb; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h13-20020aa7de0d000000b0050c06afbbdcsi14243201edv.579.2023.05.17.02.04.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 02:04:29 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=BSbhT5Lb; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 99E813856DC8 for ; Wed, 17 May 2023 09:04:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99E813856DC8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684314262; bh=laCnhH9AhA/mgRPW4gJ60I41oq1snUNBcWtGxg8OuDE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=BSbhT5Lb2AG3jDDzpUwr1/602NSS9dCqX4KH5hVDweZlI7oitEYoVrGvBrK7GTSFa RdSNFxNqNB1G0gXZEULTEbE+2PhZKrXGOW0Pdepq8HtVna7yZDTPbzOX46znrJlDlk K+quU9CUNPyNP8yNSJ4DUIOpODwBUJV8FZWBZW50= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) by sourceware.org (Postfix) with ESMTPS id 480853858D1E for ; Wed, 17 May 2023 09:03:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 480853858D1E X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R271e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018045176; MF=jinma@linux.alibaba.com; NM=1; PH=DS; RN=4; SR=0; TI=SMTPD_---0Vis8GlT_1684314207; Received: from localhost.localdomain(mailfrom:jinma@linux.alibaba.com fp:SMTPD_---0Vis8GlT_1684314207) by smtp.aliyun-inc.com; Wed, 17 May 2023 17:03:29 +0800 To: gcc-patches@gcc.gnu.org Cc: jeffreyalaw@gmail.com, jinma.contrib@gmail.com, Jin Ma Subject: [PATCH] Fix type error of 'switch (SUBREG_BYTE (op)).' Date: Wed, 17 May 2023 17:03:15 +0800 Message-Id: <20230517090315.795-1-jinma@linux.alibaba.com> X-Mailer: git-send-email 2.38.1.windows.1 MIME-Version: 1.0 X-Spam-Status: No, score=-20.8 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Jin Ma via Gcc-patches From: Jin Ma Reply-To: Jin Ma Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766131518614201017?= X-GMAIL-MSGID: =?utf-8?q?1766131518614201017?= For example: (define_insn "mov_lowpart_sidi2" [(set (match_operand:SI 0 "register_operand" "=r") (subreg:SI (match_operand:DI 1 "register_operand" " r") 0))] "TARGET_64BIT" "mov\t%0,%1") (define_insn "mov_highpart_sidi2" [(set (match_operand:SI 0 "register_operand" "=r") (subreg:SI (match_operand:DI 1 "register_operand" " r") 1))] "TARGET_64BIT" "movh\t%0,%1") When defining the above patterns, the generated file insn-recog.cc will appear 'switch (SUBREG_BYTE (op))', but since the return value of SUBREG_BYTE is poly_uint16_pod, the following error will occur: "error: switch quantity not an integer". gcc/ChangeLog: * genrecog.cc (print_nonbool_test): Fix type error of 'switch (SUBREG_BYTE (op))'. --- gcc/genrecog.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/genrecog.cc b/gcc/genrecog.cc index 6dd375da5e3..04a5533ca4b 100644 --- a/gcc/genrecog.cc +++ b/gcc/genrecog.cc @@ -4619,6 +4619,7 @@ print_nonbool_test (output_state *os, const rtx_test &test) printf ("SUBREG_BYTE ("); print_test_rtx (os, test); printf (")"); + printf (".to_constant ()"); break; case rtx_test::WIDE_INT_FIELD: