From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D8977385843E; Wed, 6 Apr 2022 09:57:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D8977385843E From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/24021] VRP does not work with floating points Date: Wed, 06 Apr 2022 09:57:57 +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: 4.1.0 X-Bugzilla-Keywords: 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: P2 X-Bugzilla-Assigned-To: aldyh 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2022 09:57:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D24021 --- Comment #22 from Aldy Hernandez --- > This doesn't take flag_rounding_math or not always exactly precise floati= ng > point computations into account. > It is also missing real_convert after real_arithmetics that performs at l= east > some of the rounding (and perhaps the inexact return value from > real_arithmetic > should be taken into account). > Without flag_rounding_math and on non-MODE_COMPOSITE_P the basic arithmet= ics > will be probably exact most of the time, except perhaps for denormals whi= ch > are > sometimes flushed to zero. But as soon as one jumps to even sqrt and oth= er > math functions, one needs to allow some epsilon up for upper bound and do= wn > for lower bound, similarly for the basic ops with inexact and > flag_rounding_math. > For MODE_COMPOSITE_P, our emulation doesn't match what is done at runtime, > so we need to be more forgiving. Definitely. I'm pretty sure there's even more stuff I'm missing :). We're only providing the core infrastructure-- the ability for ranger / vrp to ha= ndle basic floats. We're hoping some float savvy hacker can fill in the rest. The above does handle open and closed internals, though. So it should be a= ble to handle (5.0, 10.0] + [1.0, 1.0] if I understand correctly. But I don't pretend to remotely know anything about floats. I'm hoping the range-op entries can be implemented by a floating expert. A bare bones implementation would provide relops, and maybe ?? singleton fl= oats ([1.23, 1.23]).=