Message ID | 20231024103000.3334790-3-richard.sandiford@arm.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1844845vqx; Tue, 24 Oct 2023 03:31:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJWFGjuGu/tsyt1HJBSm9Es4QizegbrW5D/imePQjCujn3TPFMNnUVhaw93NzSEsg17v7G X-Received: by 2002:a05:620a:bcb:b0:770:f346:e9e8 with SMTP id s11-20020a05620a0bcb00b00770f346e9e8mr13406476qki.10.1698143489941; Tue, 24 Oct 2023 03:31:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698143489; cv=pass; d=google.com; s=arc-20160816; b=KE5j4jIS2NyoAkhrBK+eBLbXXWX+X4YvdUdspEFP8ra7aWR98DNrzTGKE8iANDXWde PtpQDMBopoLzz/JZAoI8LFnSxxbn3iRVE+nbMpt4vSuG36cVxRiMBK6Rlb39AmN28AwX Ylh0DEtwlVpZAsAG4xqex2061eiAamaYTEbxvJ9Bo0aaM9jj07P6nUfrv9NPhWxFlpDc XS682Ztj/pDUmu7iV95vCbBOIn91zJApidv2+sYJOAt+veKfCpM7kQQ+i0emIAZiVSyW yCEVcusOsqDRJFgVDRM8g/zPINTsX+yHdGCDlUzWvIc/zV1iGBFuJGTtQMb9QKoPQme9 6agg== 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=r1DAlY0Xp1kdQrgXcUOCkD5A2liDZWZgwBDrFOLumy0=; fh=C4nEn4uRKApr1WsFtLyJD8L5BeRuRc+JFyqoopFjd9M=; b=ddj7xat40N1aHSN12bM0sGuZ62+x70guqMXJ9Jd5LfaqbgJ/wO1FvwxGtJZC/ccsDn vUl1UIwMv3ZNRsnYslygOhH3+b/Vw5Fl4eEg7OHryqNJQmvvK/r/AUZ2uqEU8OrjzKW1 laU3I0xDlgk2uXxBHcDxzCkEf8zXQrSjTa+uAPZi6hnZXlCaw6defo/kyaeD/AnlkQ0k qOZUQQtTwq5eutnKdO/R9oEPQvflQUbw6b4KH83dE772/eGs8oo0drvzW5HE9IRuMve5 eLjVvKo0YpucsUMYwmIDNb81wjTGaD4BXwUpRcYvcfLDYWyCHrCK292zYGwwQYICNbR4 7Agg== 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 s8-20020a05620a0bc800b0076d9d0b221csi7042002qki.366.2023.10.24.03.31.29 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 03:31: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; 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 29EB73856263 for <ouuuleilei@gmail.com>; Tue, 24 Oct 2023 10:31:25 +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 2F2F43858C60 for <gcc-patches@gcc.gnu.org>; Tue, 24 Oct 2023 10:30:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F2F43858C60 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 2F2F43858C60 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=1698143436; cv=none; b=KDK/Lv9amGKMRCCXd4yDL3ZO8A7hnQlF5ARz+lg/UINEpL3GFrozTkzRSu5HHyl2MPho8TNn3zKcJWfyMzFQyLwDbvKrU5S8NwHGOqO6eiXv8feLnvUA0XO8c0Wddc6L+1SFrgSfMHSCSof2mO37fjllYa+WnB8vZ/1ypVmdHi4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698143436; c=relaxed/simple; bh=nwC3HBE1BdSjeSF6nAYkK898J8SZ0fLLnP/jE5QKBQE=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=sIS+nuZhh3wZExuM6O7BGn135l0JR6flVNfNBghkWTRqIGBuOHOo4d+KWyf+JlTumHpAzm3HNZhGy+xL8UCY8sediOFVBZ8DLn1Ka39+Pg1Zx0cFlYd6FppCeZVZ4kJoA32Jzd0EkFUZzf6uM7u/r0wbG9KT3Am3po7S5SeCEOo= 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 E97B42F4; Tue, 24 Oct 2023 03:31:11 -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 7893F3F64C; Tue, 24 Oct 2023 03:30:30 -0700 (PDT) From: Richard Sandiford <richard.sandiford@arm.com> To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford <richard.sandiford@arm.com> Subject: [PATCH 2/4] rtl-ssa: Fix handling of deleted insns Date: Tue, 24 Oct 2023 11:29:58 +0100 Message-Id: <20231024103000.3334790-3-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 Content-Transfer-Encoding: 8bit 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780632507812725615 X-GMAIL-MSGID: 1780632507812725615 |
Series |
[1/4] rtl-ssa: Fix null deref in first_any_insn_use
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Richard Sandiford
Oct. 24, 2023, 10:29 a.m. UTC
RTL-SSA queues up some invasive changes for later. But sometimes the insns involved in those changes can be deleted by later optimisations, making the queued change unnecessary. This patch checks for that case. gcc/ * rtl-ssa/changes.cc (function_info::perform_pending_updates): Check whether an insn has been replaced by a note. --- gcc/rtl-ssa/changes.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/rtl-ssa/changes.cc b/gcc/rtl-ssa/changes.cc index 73ab3ccfd24..de6222ae736 100644 --- a/gcc/rtl-ssa/changes.cc +++ b/gcc/rtl-ssa/changes.cc @@ -983,7 +983,10 @@ function_info::perform_pending_updates () for (insn_info *insn : m_queued_insn_updates) { rtx_insn *rtl = insn->rtl (); - if (JUMP_P (rtl)) + if (NOTE_P (rtl)) + // The insn was later optimized away, typically to a NOTE_INSN_DELETED. + ; + else if (JUMP_P (rtl)) { if (INSN_CODE (rtl) == NOOP_MOVE_INSN_CODE) {