From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C59DD3858D39; Mon, 27 Mar 2023 09:30:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C59DD3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679909420; bh=r5Uj56JRRN4mhKaHnbb9EGuX0ahMaw5aXRsRWtesf1A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=g6prolPWS1K/4focF9GhzVj4JqrGuMuZ0xbv7pTRtufr09WKNZfaZIARY7Zw5tAzu CF9GS8XD1KsCa9DkdDHuqj7gorBbzju4uA0qBwOko4cetft6agqU7jn6UrQaoQ5wnQ 5UAUcS8e6/I6QbGbCPBGXS5ywGezVxEs4naocYao= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109154] [13 regression] jump threading de-optimizes nested floating point comparisons Date: Mon, 27 Mar 2023 09:30:19 +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 X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 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=3D109154 --- Comment #12 from Jakub Jelinek --- (In reply to Richard Biener from comment #11) > _1 shoud be [-Inf, nextafter (0.0, -Inf)], not [-Inf, -0.0] Well, that is a consequence of the decision to always flush denormals to ze= ro in frange::flush_denormals_to_zero, because some CPUs do it always and others = do it when asked for (e.g. x86 if linked with -ffast-math). Unless we revert that decision and flush denormals to zero only selectively (say on alpha in non-ieee mode (the default), or if fast math (which exact suboption?) etc. (In reply to Aldy Hernandez from comment #10) > BTW, I don't think it helps at all here, but casting from l_10 to a float, > we know _1 can't be either -0.0 or +-INF or +-NAN. We could add a range-= op > entry for NOP_EXPR / CONVERT_EXPR to expose this fact. Well, at the very > least that it can't be a NAN...in the current representation for frange's. We definitely should add range-ops for conversions from integral to floating point and from floating to integral and their reverses. But until we have = more than one range, if the integral value is VARYING, for 32-bit signed int the range would be [-0x1.p+31, 0x1.p+31] so nothing specific around zero. With 3+ ranges we c= ould make it [-0x1.p+31, -1.][0., 0.][1., 0x1.p+31] if we think normal values around zero are important special cases. Not sure how that would help in this case. The reduced testcase is invalid because it uses uninitialized l.=