From patchwork Wed Jun 28 21:22:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 114076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9216905vqr; Wed, 28 Jun 2023 14:23:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5rY921M9eimBORrzXB+LX52VPXNg/1yu2bdd8jRCMxRs9sTSeqro1dpkuIQPnCz0R2TSAc X-Received: by 2002:a17:907:16a3:b0:986:38ab:ef99 with SMTP id hc35-20020a17090716a300b0098638abef99mr3066695ejc.9.1687987393348; Wed, 28 Jun 2023 14:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687987393; cv=none; d=google.com; s=arc-20160816; b=btPexOH0NOPVOUnwLzqqUe9NGxKmCfVjIArryjHSqgJ1RhAyiW3EDguwM9FFETTOVC nM1TdfKZrCCCEPYLJaHlWogunctm/W1nUP6APNXVcfkO/1QfaKYeYxEkP6elVdQdzcNl o1dOlfCoPz5XBK6orQh+SzdWnV8tX7YWPQmO1rqVJR9ss5hrvubZFT94Yl+M4XCwPt0Q 8aDNUjqa0NUhZ6ToKXa1cLF14Ai/u4E+3iwen+mDdqUJcYDYe878JNevFEYaEbmkW7M/ mL+yOUuoj95Wbb8V6xgqbzBoeJjwdAoSKRLwsBRJmtUQb5BHtZ0ioMC1gl1i7k+agtxf ZoXA== 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:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=G3alC5UXGLZyMWq2DYLCRv/bI5zP4k3hDARRw3GYiFA=; fh=gk9A5O7Gbglvz1MjrRQ4hZ2i3c68kYkpOZJg1emXh+g=; b=m4CORHuMowkKJ1CRMQwWOlalvY9hqsozQB7CcyqwTIl9I3gC9zpsiqWJkDktzmUSdE iJl88J/TwzXQWlRLxYkFCbCLYEJrgizfaf0sbvSjt5goR1ROQ60Y/5xt9yjh1O4jQ5TC pQii0Z2qUpkDL8DW520ivbWaIGp4J76S3X3OELmAwXbEV/BmaPvB9VP8WrB1hgU28KCp xUt+ZPOWpa8HA5gF9ToTZ+FemWc/9g88H0EtJdmbQ1tAdi7ZeSY90YW8FZxUVVcz5QG8 W2jhNpgBIeJzHMjbCHDkuQ6bU6IwfrzoMd+stnaBN+BBBiHoGysfcqvAZxmOwID1faVV jjSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hcUuvIUv; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id mc25-20020a170906eb5900b0098e07886dbfsi5474737ejb.622.2023.06.28.14.23.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 14:23:13 -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=hcUuvIUv; 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 1FF8F3858C1F for ; Wed, 28 Jun 2023 21:23:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1FF8F3858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687987392; bh=G3alC5UXGLZyMWq2DYLCRv/bI5zP4k3hDARRw3GYiFA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=hcUuvIUv4f/69NPq9BunGtk9f7osS+derSJ6dLZDR2AO1SIzSHQonYMYaGYmL2F3P SproYQi8LOiJlaYXjhp09M50ADn5UxdRBwEutvro4/bp3iVhf/8Wefw3Eqtzkndm6k F2mDiNo1f8DSew0cwBklfywnyx8KXjPOPmdDKShk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id E16653858C50 for ; Wed, 28 Jun 2023 21:22:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E16653858C50 To: Subject: [committed] CRIS: Don't apply PATTERN to insn before validation (PR 110144) MIME-Version: 1.0 Message-ID: <20230628212228.013E720418@pchp3.se.axis.com> Date: Wed, 28 Jun 2023 23:22:27 +0200 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson 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?1769983068746734182?= X-GMAIL-MSGID: =?utf-8?q?1769983068746734182?= Oops. The validation was there, but PATTERN was applied before that. Noticeable only with rtl-checking (for example as in the report: "--enable-checking=yes,rtl") as this statement was only a (one of many) straggling olde-C declare-and-initialize-at-beginning-of-block thing. PR target/110144 * config/cris/cris.cc (cris_postdbr_cmpelim): Don't apply PATTERN to insn before validating it. --- gcc/config/cris/cris.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/cris/cris.cc b/gcc/config/cris/cris.cc index 7fca2af085a7..f04f501326e7 100644 --- a/gcc/config/cris/cris.cc +++ b/gcc/config/cris/cris.cc @@ -375,7 +375,6 @@ cris_postdbr_cmpelim () for (insn = get_insns (); insn; insn = next) { rtx_insn *outer_insn = insn; - rtx pat = PATTERN (insn); next = NEXT_INSN (outer_insn); @@ -389,6 +388,7 @@ cris_postdbr_cmpelim () if (!NONDEBUG_INSN_P (insn)) continue; + rtx pat = PATTERN (insn); /* Consider filled delay slots; there might be a comparison there. It's only the second insn in a sequence that is interesting. */