From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 82A803858C41; Tue, 31 Oct 2023 10:43:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82A803858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698748993; bh=2aYYfxezdt3gqzIxFzSDnKNw2+jTq4iCJi+BuMSfG3o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yCS3G1epf2/9+Zw+zirMRZGhj9VCvyXvEToD3uWE3tKrwiuaJbn+qpwENWftYuqC5 9r6LmICv9YMuq15xRiYRmm6drrgQeCK+2tMEJSi3X98azKWGTLkFuKXkvxrUjWXiPc 5ErdQb9LoOCbIUg6lqSOKjblPIHM7I8k6Y8vKkew= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112307] Segmentation fault with -O1 -fcode-hoisting Date: Tue, 31 Oct 2023 10:43:13 +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: needs-reduction, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: see_also 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=3D112307 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D109945 --- Comment #3 from Richard Biener --- The transform in main is because we do Value numbering stmt =3D _22 =3D &MEM [(void *)&intersections + 1B] =3D=3D _34; Applying pattern match.pd:6940, gimple-match-5.cc:1815 Match-and-simplified &MEM [(void *)&intersections + 1B] =3D=3D _34 to 0 RHS &MEM [(void *)&intersections + 1B] =3D=3D _34 simplified to 0 Setting value number of _22 to 0 (changed) Value numbering stmt =3D intersections.end_reached_ =3D _22; No store match Value numbering store intersections.end_reached_ to 0 Setting value number of .MEM_93 to .MEM_93 (changed) Value numbering stmt =3D if (&MEM [(void *)&intersections + 1B] =3D=3D _34) marking known outgoing edge 12 -> 15 executable and that's using /* Simplify pointer equality compares using PTA. */ (for neeq (ne eq) (simplify (neeq @0 @1) (if (POINTER_TYPE_P (TREE_TYPE (@0)) && ptrs_compare_unequal (@0, @1)) { constant_boolean_node (neeq !=3D EQ_EXPR, type); }))) which makes it really a similar issue as PR109945 - _34 points to nonlocal/escaped but 'intersections' isn't part of that set though it probably "escapes" at [local count: 118111600]: intersections =3D CompositeMesh::Intersections (&mesh); [return slot optimization] -fno-tree-pta is a (quite heavy) workaround.=