From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D9D183858C53; Mon, 19 Sep 2022 07:31:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9D183858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663572695; bh=QTbI+sATWkAwhqIjOVaMVdx6eS18BykmPToF/ZaiSbs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=t543glyZvhu3T51D2egbJu47CXWrlz4tApYylfMIXzrehP5zQuebt8OdNEjLXCbxd Zfb/Z8fMtv5QqayQ5ps7odUUywZP+UmAChibNJGdze/ug8wdiJ7DgwgKGzMXHvDbwM J7pMmIGSd8tLPz14wrUcs3HI28eo/9yIaqTAHvU4= From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/68097] We should track ranges for floating-point values too Date: Mon, 19 Sep 2022 07:31:35 +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: 6.0 X-Bugzilla-Keywords: compile-time-hog, missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: aldyh 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: --- 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=3D68097 --- Comment #8 from Aldy Hernandez --- (In reply to Richard Biener from comment #7) > Yes, I think fixed in that we can now record info on FP SSA names. There > are other bugs for specific things. >=20 > What's not fixed is that we still recurse to SSA defs in > gimple_assign_nonnegative_warnv_p and friends. We might think to fix that > now, I see. If I understand things correctly, you may want to do something like: if (frange::supports_p (TREE_TYPE (name))) { frange r; bool sign; if (get_global_range_query ()->range_of_expr (r, name) && r.signbit_p (sign)) return sign =3D=3D false; } That is, get the global range of the SSA name, and if it has a known signbi= t, you should be able to determine if it's nonnegative. The above works corre= ctly for signed zeros now too.=