From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DA9573858C2C; Tue, 7 Mar 2023 18:52:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA9573858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678215171; bh=I98KRzqVXAOo6s/15546Pe/tji7kp3fklykWNbGRp1Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wMGDLktSM9HofQvgRZqg41fEYoFXYRp+/QLZmLARb664U8tiwl/MOKuUhXr07d8aa ISrOyjER/6dKg9lf5TFXT2vODf6rdEnW37bBS9ermvdX/mxvjmFynmaMFq6Z7+sF3p U8EbKOk5xs8uiY7b7lpVP7ig1EwxMcd1/fPQBt6M= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109008] [13 Regression] Wrong code in scipy package since r13-3926-gd4c2f1d376da6f Date: Tue, 07 Mar 2023 18:52:51 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: attachments.isobsolete attachments.created 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=3D109008 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54599|0 |1 is obsolete| | --- Comment #23 from Jakub Jelinek --- Created attachment 54601 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54601&action=3Dedit gcc13-pr109008-wip.patch Here is an updated version of the WIP, I think this one now works (but is o= nly hooked up in the foperator_plus::op{1,2}_range and not for -, * and /. Also, it returns the first smaller value (for low bound) or first larger va= lue (for upper bound) for which the test already isn't met, while I think we sh= ould set it to nextafter of that towards inf for the former and nextafter of that towards -inf for the latter. I can try to get statistics from it and also whether the loop over signific= and bits is needed and helps something. I've added another thing to the heuris= tics to narrow down the range for the binary search on exponents, in particular = the maximum exponent from the lhs and op2 bounds (all 4 of them) next to the l = + p and l + 8 * p tests. Bet detailed statistics can help to point what helps = and what doesn't. If we get some smart math (or even the patch you've provided), I guess we c= an try to compare the two implementations for the precision of the ranges as w= ell as compile time cost.=