From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7C2A03858C83; Mon, 27 Mar 2023 10:44:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C2A03858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679913897; bh=cJW7UY+O6SsKu2+03ol66kPUkyEcD/gd/oqUABTl9c0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YFo69GLaQJbXJRtalkW474DXdeCz99Mwp0oiDGQERbW1MGFYr+oALLHSTCjIYciJ+ LovaFZBACZBzTqrLALWiUujOgSmdxhRQh7ZB38K+it6bPaNCgmKCsCghDxo76x3Sop pMZ7BFtgC26zjFwmjOTIsOL5P8rqMwqAzH0BCOQk= 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 10:44: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 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 #17 from Jakub Jelinek --- (In reply to rguenther@suse.de from comment #15) > I think flushing denormals makes sense for "forward" propagation, Well, it still hurts quite a lot exactly for the ranges around zero. Given that most CPU honor it most of the time, I think asking users to use -funsafe-math-optimizations/-ffast-math/-Ofast if they instruct the CPU not to do that is fine (different situation is Alpha where it is the default behavior). > Given -ffast-math on x86 enables FTZ we'd have to be conservative there > as well. But OTOH we don't have any HONOR_DENORMALS or so? We don't but that is roughly what my patch adds... > Note the testcase in this PR was about -Ofast ... Indeed, for ranges from comparisons we could ignore the flush_denormals_to_= zero calls always; guess we'd need to add some defaulted new flag to set, pass t= rue to it from the comparisons and don't call it if the flag is set. In addition or instead of the above patch. Aldy?=