From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F8043858C74; Fri, 27 Jan 2023 07:35:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F8043858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674804943; bh=aEAOSYocw3wAibrQQFaD3/zMYRs8kmcC4wUIF8GXWC8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iupXVQRo5EE/say4S5hXTW5vH7nLIVN6lMdh6NUL2GrdgUOhZqzUVur0HWkemaIK+ H5jYu+RV0ln7TDsL0U33KY9P1+BypJ/zsv2ijiAN9NJLNA0GTk/Q3rRM4eqnWvbbT+ bRWjJX2U5bl1HgAQW2s4Lxo4kBJEOlbysGLIq+MY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107608] [13 Regression] Failure on fold-overflow-1.c and pr95115.c Date: Fri, 27 Jan 2023 07:35:39 +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.0 X-Bugzilla-Keywords: missed-optimization, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D107608 --- Comment #45 from Richard Biener --- (In reply to Xi Ruoyao from comment #44) > (In reply to rguenther@suse.de from comment #43) > > On Thu, 19 Jan 2023, xry111 at gcc dot gnu.org wrote: > >=20 > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107608 > > >=20 > > > --- Comment #42 from Xi Ruoyao --- > > > (In reply to Richard Biener from comment #41) > > > > We could fix the testcase with > > > >=20 > > > > diff --git a/gcc/testsuite/gcc.dg/pr95115.c b/gcc/testsuite/gcc.dg/= pr95115.c > > > > index 69c4f83250c..09273e445d2 100644 > > > > --- a/gcc/testsuite/gcc.dg/pr95115.c > > > > +++ b/gcc/testsuite/gcc.dg/pr95115.c > > > > @@ -17,6 +17,7 @@ int > > > > main (void) > > > > { > > > > double r =3D x (); > > > > + volatile double rr =3D r; > > > > if (!__builtin_isnan (r)) > > > > abort (); > > > > if (!fetestexcept (FE_INVALID)) > > > >=20 > > > > that preserves optimizing the isnan check but also preserves the co= mputation > > > > and checks the non-propagation of a NaN. > > >=20 > > > Hmm, so it means we cannot rely on Inf / Inf to raise an exception? = Then we > > > need to fix Glibc... > >=20 > > If the result is unused then no, GCC will happily elide exceptions from > > unused computations like Inexact from the statement > >=20 > > 1./3.; > >=20 > > but this has been done before. What's new is that GCC can now elide > > some uses (in this case the isnan check is the only use) >=20 > The should we just change PR95115 to "INVALID" and remove the test case, = and > fix any regression on Glibc side? I think we should adjust the testcase with a volatile like I suggested above so we verify that we don't eliminate the computation with a "constant" NaN.=