From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 372C53857C43; Fri, 27 Oct 2023 14:14:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 372C53857C43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698416044; bh=0exXFBHqidqzrLLTHbfqmLc9VTjIt5DlcfnVCKM6DhM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=seam2wKOQ8k7M0BCYfPA6r7FUUbNS+dopHI99QSEagU9s+SEjX/wF1BLrOMfx6hRs N+4QuvYEOtx62KJp2JslxSEnfiApL+6eQv1H9ePtfprUQDzRnsaOIwognn70GIU9tg CDcg9mjcH4AHrqwrR4FI0mZ4SDlGhfkFfnk6k3C0= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111950] [14 Regression] ICE in compute_live_loop_exits, at tree-ssa-loop-manip.cc:250 since r14-4786-gd118738e71c Date: Fri, 27 Oct 2023 14:14:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc keywords 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=3D111950 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tnfchris at gcc dot gnu.org Keywords| |ice-on-valid-code, | |wrong-code --- Comment #2 from Richard Biener --- For the epilog LC-SSA we lack the correct SSA name for the skip edge: [local count: 16140304]: # prephitmp_78 =3D PHI # c_I_lsm.18_79 =3D PHI # iftmp.0_80 =3D PHI see how c_I_lsm.18_60 is used for both args but the name is defined in the epilog only. Though it looks like the original reduction variable isn't computed at all for the loop which means the reduction vectorization is wrong. if-conversion turns [local count: 146730041]: # d.12_13 =3D PHI _1 =3D a.3_23 >> b.2_22; if (_1 !=3D 0) goto ; [50.00%] else goto ; [50.00%] [local count: 146730041]: # iftmp.0_9 =3D PHI <1(13), iftmp.0_39(11)> # c_I_lsm.18_38 =3D PHI <1(13), a.3_23(11)> # prephitmp_43 =3D PHI <1(13), a.3_23(11)> _37 =3D d.12_13 + 1; if (_37 !=3D 0) goto ; [89.00%] else goto ; [11.00%] into [local count: 146730041]: # d.12_13 =3D PHI <_37(15), d.12_5(26)> iftmp.0_9 =3D _32 ? 1 : iftmp.0_39; c_I_lsm.18_38 =3D _32 ? 1 : a.3_23; _37 =3D d.12_13 + 1; if (_37 !=3D 0) goto ; [89.00%] else goto ; [11.00%] turning c_I_lsm.18_38 into a fully invariant reduction def which likely isn= 't supported - we had bugs here in the past with not relevant but live stmts. But if-conversion also performs the (now valid) hoisting, this is maybe why it was triggered by that rev.=