From patchwork Tue Oct 24 10:29:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 157373 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1844872vqx; Tue, 24 Oct 2023 03:31:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH78sPUoWwQw9resYq7vWA6QdvSPc3Pr+p3sJd/nWRn0KRGe6CQ04UN0KOaZ/5/kYM8ffnd X-Received: by 2002:ac8:7f82:0:b0:417:a862:4b with SMTP id z2-20020ac87f82000000b00417a862004bmr12331065qtj.33.1698143493038; Tue, 24 Oct 2023 03:31:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698143493; cv=pass; d=google.com; s=arc-20160816; b=mW14/j8gHeE3Xqr8EcVNVwqV4gijbA9cTJoNTMDLpMI8iRM5A/2ok62UDZ3o87CnTa 4KJ1lcysIgu1/SItvNfFSdusEAcbMPJ9y0KAZ7B6KSMcsHlsOtpJ61Mji8CXztTUKa4K 6TqGMTeBQfP/5l1kbq+WyJcDpAf7AOpD6SEavKgml9VdbnYW23MoizpHhzVKHLo4UpVg g/7xDQzic9kzWOtNaisoUy5zzTWLlQA/2EatOgyKroynf2ciENiJDPDWlTwJgIrV/VTw i2/eZ1QQSDD0SQOxOY8OxMWNdS+9+h+cyEYoXv+pnICQjou1cPf1Epn23BI4SRlckf7p S1LQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:arc-filter:dmarc-filter:delivered-to; bh=fnS/Ex5aDRoZ/A8Bzr1KI8WDgwXHdUCQOtLuxi8bHW0=; fh=C4nEn4uRKApr1WsFtLyJD8L5BeRuRc+JFyqoopFjd9M=; b=r3Il2QgHnqdt6mJIokl44ypjxBm6tNuH+Oh+MYRFuZseDkDQ/AhBYb3m2x2BfPVTrK EcoSIQ1VNpZsHV5e0EbnPNTNBCl7ujtAz+KHvbaWIlELqks2cQk5MasJlesp0Q7kh8bO S8eyVvBWYF62N9KNhhdb3TZly9h7VglEpR3CiXEnxOmUPnU8k9RalZxo803uTSbdWwMf Uya4V9xFlU9s0acNPTUbHb/XapHWkP5g5rbrBdKwBcYusziCyeV/CtYzklgXRfS/b/Fc LICTEab07vsvRY3U39ZNSv/JplBz9nPksihE445lI9VjsMnP2/IWhSull4mWxHn0ybbB CHQg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id l13-20020a05622a050d00b0040fe32ab0b6si6776349qtx.286.2023.10.24.03.31.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 03:31:33 -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; arc=pass (i=1); 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 632CE385C6E4 for ; Tue, 24 Oct 2023 10:31:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 89B8A3857B98 for ; Tue, 24 Oct 2023 10:30:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 89B8A3857B98 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 89B8A3857B98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698143441; cv=none; b=EjMHMilr5A8o/gQqhaOZc8hlDen7k7B57cGWqGg1/uIyO03PhlXRJFmVfY2FwIxHFhPmNh1XCTfqQr/1pfaLV6P+FKoE5+fz+C3/ZL4VjeILAxyAdCiGwqZVXmZlNXBK7PAy50YtklaX5UvkvhMqdM4YLfCmFmX5IPTSjuzHi5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698143441; c=relaxed/simple; bh=qsCP35HIjdambzq8CKhoh3i0Q0JPnKDiSEecc2Elapw=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=WbGq7ySjaZugSkKEQiHVMst4wKSBaaCwo/cc6iU8kSLqXma28wvQCS6VvEyLBflmSvlNIpyrYe41pUqipmW3IM9fvCmJVTd9ASfsg6vyw0+3MV88JByfcXxh7fxEfkzCOp+KyhheE2buRaebvgZMsDcI1NttRze2rAW7V/8lnag= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4CF322F4; Tue, 24 Oct 2023 03:31:17 -0700 (PDT) Received: from e121540-lin.manchester.arm.com (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D07733F64C; Tue, 24 Oct 2023 03:30:35 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford Subject: [PATCH 3/4] rtl-ssa: Don't insert after insns that can throw Date: Tue, 24 Oct 2023 11:29:59 +0100 Message-Id: <20231024103000.3334790-4-richard.sandiford@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231024103000.3334790-1-richard.sandiford@arm.com> References: <20231024103000.3334790-1-richard.sandiford@arm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-24.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780632511433347862 X-GMAIL-MSGID: 1780632511433347862 rtl_ssa::can_insert_after didn't handle insns that can throw. Fixing that avoids a regression with a later patch. gcc/ * rtl-ssa.h: Include cfgbuild.h. * rtl-ssa/movement.h (can_insert_after): Replace is_jump with the more comprehensive control_flow_insn_p. --- gcc/rtl-ssa.h | 1 + gcc/rtl-ssa/movement.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/rtl-ssa.h b/gcc/rtl-ssa.h index 7355c6c4463..3a3c8b50ee2 100644 --- a/gcc/rtl-ssa.h +++ b/gcc/rtl-ssa.h @@ -49,6 +49,7 @@ #include "obstack-utils.h" #include "mux-utils.h" #include "rtlanal.h" +#include "cfgbuild.h" // Provides the global crtl->ssa. #include "memmodel.h" diff --git a/gcc/rtl-ssa/movement.h b/gcc/rtl-ssa/movement.h index d9945f49172..67370947dbd 100644 --- a/gcc/rtl-ssa/movement.h +++ b/gcc/rtl-ssa/movement.h @@ -61,7 +61,8 @@ move_earlier_than (insn_range_info range, insn_info *insn) inline bool can_insert_after (insn_info *insn) { - return insn->is_bb_head () || (insn->is_real () && !insn->is_jump ()); + return (insn->is_bb_head () + || (insn->is_real () && !control_flow_insn_p (insn->rtl ()))); } // Try to restrict move range MOVE_RANGE so that it is possible to