From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4A7D43896342; Thu, 15 Dec 2022 15:51:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A7D43896342 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671119473; bh=0uAOtDhxe2Zpb/TIvafvSRMz5YpK3V/HOoEiRoGFWcA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gRfHCA2wRB7ZjQOWA1nBdjB4QsslusJkhq3RwNYtgI/ZOiBD/dIAAEQOfJOUWqWOE zHJR8oO9KwyM3RMDiGVS0NhEgJmBMK/l1b2moYJASfI9wS9wOwUXdA1Wf37hnJVbge T19u4J96jHHfkpNoSQ/7EbNqFcu5NyjoTKXboogA= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/106751] [10/11/12/13 Regression] internal compiler error: in purge_dead_edges with inline-asm goto Date: Thu, 15 Dec 2022 15:51:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: ice-on-valid-code, inline-asm X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D106751 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org, | |rguenth at gcc dot gnu.org --- Comment #9 from Jakub Jelinek --- I'm afraid I don't know much about the RTL lim, but 1840 reorder_insns (inv->insn, inv->insn, BB_END (preheader)); with no check whether it is actually ok to append the statement at the end = of the preheader bb (at least no check that I can find) sounds wrong to me and= I'm just confused why it doesn't break stuff much more often. >From what I can see, loop-invariant.cc pass happens in between loop2_init a= nd loop2_done passes where the former calls loop_optimizer_init (LOOPS_NORMAL | LOOPS_HAVE_RECORDED_EXITS); which should ensure that loops have preheaders, but doesn't actually ask for LOOPS_HAVE_FALLTHRU_PREHEADERS. If the latter was on, then create_preheader would force splitting of the ed= ge: /* If we want fallthru preheaders, also create forwarder block wh= en preheader ends with a jump or has predecessors from loop. */ else if ((flags & CP_FALLTHRU_PREHEADERS) && (JUMP_P (BB_END (single_entry->src)) || has_preds_from_loop (single_entry->src, loop))) need_forwarder_block =3D true; So, should loop-invariant.cc split_edge the preheader edge if preheader blo= ck ends with JUMP_P, or shall we somehow arrange for LOOPS_HAVE_FALLTHRU_PREHEADERS?=