From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E618F385840D; Wed, 8 May 2024 19:58:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E618F385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715198306; bh=JUGiEzc3kQvMic5LhYrcHF377tymYq7bUVn3/RAmgeo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RJEE+OVN9W4XMR20yKcimQeffByY5aHQ5hrUNMdLl3BTZsQ94alZrJsiRA3euar8u ZyObGc1Oa+OfWTbJJoGfy/LvM6DeAeiHPWfO6yaxl4o05TbMT0JD1vG16r88oTrM05 eoJyCIjWeJ1CVBQgbNBM7oHpzEnjsT9lFCSbEvxY= From: "jakub 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 19:58:26 +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: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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 #28 from Jakub Jelinek --- (In reply to Dmitrii Pasechnik from comment #26) > We have megabytes of code calling libraries where setjmp/longjmp is used, > in github.com/sagemath/sage/ (most of it in Cython). >=20 > It looks like a huge hassle to put volatiles there.=20 > Looks like we would need ways to disable particular optimisations which l= ead > to these sorts of errors:-( You mean turn off all optimizations then? -O0. Even that doesn't guarantee it will work if some such variables are declared with register keyword. It isn't just POSIX which says this, e.g. C99 also says: "All accessible objects have values, and all other components of the abstra= ct machine have state, as of the time the longjmp function was called, except that the values of objects of automatic storage duration that are local to the function contai= ning the invocation of the corresponding setjmp macro that do not have volatile-qualified type and have been changed between the setjmp invocation and longjmp call are indeterminate." C89 said pretty much the same.=