From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2656D3858C50; Tue, 5 Mar 2024 11:34:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2656D3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709638485; bh=qYuKC3in1BjP1mmIM0oxlNy5HKK7nhtAssPfR1jPkkU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ixGGbO5PgTeI7ofor6Z2M30c4hdnmyodOAPUqzDQVIIPet/UvUCrx/YqqfWRwzIGL hjs8lBh1zhioBiF12jEdzQPyrC5k/tvG2DFM3P5ReTwi1EXGq768EIJNFX1gZ7q450 qDFSIuwecTZJZaxkMIaUuP60+rINAlTNvX7cXM7o= 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, 05 Mar 2024 11:34:43 +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: cc 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 ---------------------------------------------------------------------------- CC| |redi at gcc dot gnu.org --- Comment #4 from Richard Biener --- I don't quite see how return EnumeratorRange(Enumerator(std::views::single(Intersection()))); makes CompositeMesh::Intersections() return an object that refers to itself but points-to doesn't consider it could: callarg(12) =3D &mesh ... ESCAPED =3D &mesh intersections =3D NONLOCAL intersections =3D callarg(12) debugging at -O0 shows (gdb) p intersections $1 =3D {enumerator_ =3D { range_ =3D { >> =3D= {}, _M_value =3D {_M_value =3D {is_boundary_ =3D true}}},=20 begin_ =3D std::optional =3D { [contained value] =3D 0x7fffffffde80}}, end_reached_ =3D false} (gdb) p &intersections $2 =3D (EnumeratorRange *) 0x7fffffffde80 so it contains a reference to itself. As said this feels like those other issues which are maybe invalid because of object lifetimes. But maybe there's sth special here.=