From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B185F385BC23; Wed, 23 Feb 2022 08:14:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B185F385BC23 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104644] [12 Regression] ICE: SIGSEGV (infinite recursion in fold_binary_loc / fold_build2_loc / generic_simplify_NE_EXPR) Date: Wed, 23 Feb 2022 08:14:06 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2022 08:14:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104644 --- Comment #3 from Richard Biener --- (In reply to Jakub Jelinek from comment #2) > Created attachment 52494 [details] > gcc12-pr104644.patch >=20 > Untested fix. >=20 > The match.pd optimization relies on (bswap @1) actually being simplified > into something other than bswap when @1 is INTEGER_CST, but that isn't > guaranteed at least in GENERIC - due to TREE_OVERFLOW in there. > The patch uses ! to enforce simplification of that and because ! isn't > supported in GENERIC, also requires GIMPLE for the optimization. Huh, it's odd that GENERIC would care for TREE_OVERFLOW when constant foldi= ng bswap .. where does it do that?=