From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 144503858D20; Sat, 21 Jan 2023 20:13:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 144503858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674331985; bh=j7i+HgeXA+1CyAxf18/e5gQuQEDYJfL83W8mBHuVi+U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vqt1d8J3jZJppONWC+ToHQWLHZiyFyLmHhtd8iaJdnw1XkKWjF+JfnnPNcHE+Pv69 e+Ky/nVywAx7UhIymsYVK/+rlFRfLW/HWybZErpsCggTA7vTgHpLcSi6hSzlMNTP2u Oms9qgqgP1LUNNtWd2RN9GdAezTgkzVp6MpL6Y2U= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108482] [13 Regression] ice in expand_LOOP_DIST_ALIAS with -O3 -ftrivial-auto-var-init=zero Date: Sat, 21 Jan 2023 20:13:04 +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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 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=3D108482 --- Comment #12 from Andrew Pinski --- This is just a latent bug exposed by Richi's copyprop improvement. Folding statement: ivtmp_37 =3D ivtmp_38 - 1; gimple_simplified to ivtmp_37 =3D 1; Folded into: ivtmp_37 =3D 1; Folding statement: if (ivtmp_37 !=3D 0) Not folded While trunk (GCC 13): Folding statement: ivtmp_9 =3D ivtmp_39 - 1; Queued stmt for removal. Folds to: 1 Folding statement: if (ivtmp_9 !=3D 0) gimple_simplified to if (1 !=3D 0) Folded into: if (1 !=3D 0) Which is the correct thing to do and removes an branch earlier. Which then removes a few extra loops. Except now LOOP_DIST_ALIAS is not conditionalizing two loops any more.=