From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 613303858C36; Thu, 19 Jan 2023 07:17:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 613303858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674112647; bh=LCejHlRCOfvM8fzNzWPDYsdYI0kNTnD2JLbyJfBynE0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=E/v72uIwZdhGHtnp/Gx1CdIxC9UjSIwIdHKpB8if4/iBSmrGYZOEKHx6TynnnQ04K LZIHsZ6TqSZJ13H2NpOLEhGROusLdzRhiPBWcabbn8y/hP2KCz3tQKOvaSUMYzV/KY 9RlMvQTOZzCFpD+rSX0+qys2tke2THhT1TYiZ0MI= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107608] [13 Regression] Failure on fold-overflow-1.c and pr95115.c Date: Thu, 19 Jan 2023 07:17: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.0 X-Bugzilla-Keywords: missed-optimization, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de 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 #43 from rguenther at suse dot de --- On Thu, 19 Jan 2023, xry111 at gcc dot gnu.org wrote: > 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/pr95= 115.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 comput= ation > > 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... If the result is unused then no, GCC will happily elide exceptions from unused computations like Inexact from the statement 1./3.; 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)=