From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9127938A1402; Wed, 8 May 2024 08:27:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9127938A1402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715156855; bh=a3liMOo5CxA5X0tVpZIYICBXej4Znte/f4k69qJ3rbE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wHMjPZsCkkoilqpPZny4sBx3Hkc+ltmyUt9kbx3pZnxQU1f/KP5K+jQ9m4zF3cCF/ omrVdaQks1HczmgJuh0PJjksyQDxXKrD+qtjPp+a2asAUFqlE8x2cWpgoJcnfquM46 fUIdu0hncpZudZigSmLcAIObFK10ar26C3J6GIvM= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114872] [13/14/15 Regression] Miscompilation with -O2 after commit r13-8037 Date: Wed, 08 May 2024 08:27:35 +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.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 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=3D114872 --- Comment #24 from Richard Biener --- (In reply to Sergei Trofimovich from comment #23) [...] > Why did `gcc` generate unconditional NULL dereference here? I suspect it > somehow inferred that `__pyx_t_6 =3D NULL;` in that branch, but not before > comparison. That's what happens if we isolate an unreachable path because of a NULL dereference (like if exposed by jump-threading). We make the NULL dereference volatile so it stays but DCE/DSE can cleanup code on the path leading to it. If you run into such path the this might suggest that jump-threading trigge= red a problem with the setjmp/longjmp, so it's then likely some condition that's evaluated in a wrong way after the longjmp, either because a dependent value wasn't properly preserved or by GCC breaking that. Seeing stack memo= ry arguments used on a call in a previous comment I wondered if POSIX suggests that even non-register variables need to be made volatile and thus whether SRA or FRE might impose problems with code using setjmp/longjmp.=