From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9288E3858C20; Wed, 30 Nov 2022 11:51:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9288E3858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669809097; bh=jnzoL3Dvkd6M5uFRMTzl1+HUe+2PcnoUkh8VGuROADI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=G4msAw8oqurdszBMzZjl/55/MuCOxqOvbFV5+JenMLCOpOVCQ4U/xks4TohU8IjAI pME3QlxWeYu9udZvpNgKcnmRdb8t55RO41AQsFP165kggfK0wag87SX+7mMvzWPOIu WtciIJjrWR2hwD1WmnrMS9igQX2v3TV/Spz76UVE= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107920] [13 Regression] ICE in execute_todo, at passes.cc:2140 Date: Wed, 30 Nov 2022 11:51:37 +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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.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=3D107920 --- Comment #10 from Richard Biener --- (In reply to Andrew Pinski from comment #7) > Something like this should fix the issue (note setting the location should > be done also): > diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc > b/gcc/config/aarch64/aarch64-sve-builtins-base.cc > index 6347407555f..d0a0a3a0a46 100644 > --- a/gcc/config/aarch64/aarch64-sve-builtins-base.cc > +++ b/gcc/config/aarch64/aarch64-sve-builtins-base.cc > @@ -1232,6 +1232,15 @@ public: > tree mem_ref_op =3D fold_build2 (MEM_REF, access_type, arg1, zero= ); > gimple *mem_ref_stmt > =3D gimple_build_assign (mem_ref_lhs, mem_ref_op); > + > + // Set the location of load > + gimple_set_location (mem_ref_stmt, gimple_location (f.call)); > + > + // Set the vuse for the load from the call > + tree reaching_vuse =3D gimple_vuse (f.call); > + gcc_assert (reaching_vuse && TREE_CODE (reaching_vuse) =3D=3D SSA= _NAME); > + gimple_set_vuse (mem_ref_stmt, reaching_vuse); > + > gsi_insert_before (f.gsi, mem_ref_stmt, GSI_SAME_STMT); >=20 > int source_nelts =3D TYPE_VECTOR_SUBPARTS (access_type).to_consta= nt (); All this should build a sequence of the replacement stmts and then use gsi_replace_with_seq. Note transfering EH will not work during folding since that would require splitting the block. Does the builtin even throw with non-call EH? Why does it throw without?=