From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5F5A03857C41; Fri, 26 Jan 2024 11:47:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F5A03857C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706269621; bh=5NXvh7/CMwwhRTxybhErTY7AU7kHnD6E7b+vCNIY7C4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QgiEsaucvVvs9gHqhwg4LdEqZTzWB4Sb9DyAMpNrgLFc/4dTOWR25tQofcgQaUdzw tacQNKBi9/2ecuwg+cqcudlepMkxn8tuGhG9ZoAdgZhll6y7e8bflP89nUh4eNn3c/ VUrdyaypjX8QwgOEV37MsmgrTxHewfEnaFSUyaxs= From: "acoplan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113616] [14 Regression] ICE in process_uses_of_deleted_def, at rtl-ssa/changes.cc:252 Date: Fri, 26 Jan 2024 11:47:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: acoplan at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: acoplan at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113616 --- Comment #2 from Alex Coplan --- I think the problem is this loop (and others that iterate over debug uses in this way): // Now that we've characterized the defs involved, go through the // debug uses and determine how to update them (if needed). for (auto use : set->debug_insn_uses ()) { if (*pair_dst < *use->insn () && defs[1]) // We're re-ordering defs[1] above a previous use of the // same resource. update_debug_use (use, defs[1], writeback_pats[1]); else if (*pair_dst >=3D *use->insn ()) // We're re-ordering defs[0] below its use. update_debug_use (use, defs[0], writeback_pats[0]); } because `update_debug_use` can remove uses from the list of debug uses, we can't use a for-range loop as the iterator will become invalidated before getting advanced. Should be fairly straightforward to fix, sorry for the oversight.=