From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 819133858C31; Mon, 29 Apr 2024 20:05:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 819133858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714421153; bh=wITyJhX8MzAOaEUzSJP3eiobQ8gAYoLLPlnJGrLyoeQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LMjWGTv+CTuq2IJFtfwKxUkVIWiNlTzSlzI55Ic6k3N68taUAxylyYzpCFr/gS/oI dKgl/vWV1k9zrt7drJG0Akazvv72tfg2RWtT7gb2mZzrXpB4Q4Q/iCXnzldiNIJegf 4OPHBgvmTQdHosiPrDYzPocHeaKht3h5jVDREm+0= From: "arojas at archlinux dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114872] [13/14/15 Regression] Miscompilation with -O2 after commit r13-8037 Date: Mon, 29 Apr 2024 20:05:52 +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: arojas at archlinux dot 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 #7 from Antonio Rojas --- (In reply to Sam James from comment #5) > Some ideas: > * Could you maybe give a reproducer for the runtime crash? In sage, calling any libgap function in exactly 3 parameters triggers this.= For instance: sage: libgap.AbelianGroup(0,0,0) Note that you need Python 3.12 to get the crash (which happens when trying = to derefence the null pointer in the newly introduced _Py_IsImmortal function) > * Any chance you'd be willing to try bisect element.i with pragmas to > disable/enable optimisation for chunks of it, to find the miscompiled > function? I have done that. As expected, the problem is in Py_XDECREF. This makes the problem disappear: #pragma GCC push_options #pragma GCC optimize ("O0") static inline void Py_XDECREF(PyObject *op) { if (op !=3D=20 # 797 "/usr/include/python3.12/object.h" 3 4 ((void *)0) # 797 "/usr/include/python3.12/object.h" ) { Py_DECREF(((PyObject*)((op)))); } } #pragma GCC pop_options=