From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1A3F2385CDC6; Thu, 30 Mar 2023 11:09:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A3F2385CDC6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680174585; bh=zaBebqj09ofm5GD21QBBK5Lt/imVcJjdmciTUPtEpak=; h=From:To:Subject:Date:In-Reply-To:References:From; b=q6I40hHjIRarWNYGLV8MP0UwDpNkmlz9ZQfy/Xhfoz/etcWFN364JmWkw6lfiXDCN RfW+KaGBupNGZ4ghl1/Az6pxZ29/YedUSwpSNAI9TxTUcAKyaTVDnCw2JOJX98hwS+ VcQWNN677CZAU20fshGNyfIG62NIHGzpTUDBUaZI= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109344] feraiseexcept produces incorrect code when optimizations are enabled Date: Thu, 30 Mar 2023 11:09:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: --- 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=3D109344 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- I get the same result for all of -O0/-O1/-O2, all 3 functions raise both exceptions and that is correct, glibc has removed the inline versions some = time ago: https://sourceware.org/pipermail/libc-alpha/2020-March/111753.html The bug was on the glibc side: both the /* One example of an invalid operation is 0.0 / 0.0. */ float __f =3D 0.0; # ifdef __SSE_MATH__ __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f)); and float __f =3D 1.0; float __g =3D 0.0; # ifdef __SSE_MATH__ __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); part, because glibc didn't tell the compiler the inline assembly actually modifies the register. So, the first one was supposed to be __asm__ __volatile__ ("divss %0, %0 " : "+x" (__f)); and the second __asm__ __volatile__ ("divss %1, %0" : "+x" (__f) : "x" (__g)); Not a bug on the GCC side and on glibc side it has been fixed by the remova= l of the inline version.=