From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7A9AD3858C00; Fri, 27 Jan 2023 07:59:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A9AD3858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674806397; bh=Twl+fvUa0yPgBk+gcZaZatMtTTT+u6NtObe34/z1B1M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wTTZCKRSqjIFmQZmWFDRF4gwzbG6ZdnqpipBTwZGA4p6y6Tomo1E3a3sj75AjYRbG 3qL8HpERn+AIzh8uPZOG+nqRYtNTGdN0VvVShZ+WypJ3sh6jSVvW+LTEgwDuhutSE7 BcBpr8RMHVae6p9VOBVRnRFdbYP+Ks1qp3WA7f1Q= From: "xry111 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:59:56 +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: xry111 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 #46 from Xi Ruoyao --- (In reply to Richard Biener from comment #45) > (In reply to Xi Ruoyao from comment #44) > > (In reply to rguenther@suse.de from comment #43) > > > If the result is unused then no, GCC will happily elide exceptions fr= om > > > 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? >=20 > I think we should adjust the testcase with a volatile like I suggested ab= ove > so we verify that we don't eliminate the computation with a "constant" Na= N. Ok, I'll post a patch. Glibc already changed the code from Inf/Inf to (x - x) / (x - x) where x is= not a constant, but I'm wandering if the compiler will attempt to optimize out = (x - x) / (x - x) later... Is it possible to provide a "__builtin_feraiseexcept= " so we'd be able to use it instead of the nasty (x - x) / (x - x) to raise the exception?=