From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 13AC138555A0; Wed, 8 Mar 2023 18:56:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13AC138555A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678301813; bh=kfW133QSRXfNRGGXVo+ilS2YCLFkcfmgLxH2yXwWZUA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PAtvaNdjaTNZqucoXcLrUbEFMZAkM2NeRQOMYMXxRAcgQl5J6K9WM7avhQ6Qd3IgS BirrwQJaTAUbhJq6wcrf24uCqu3AQJu2O+jL2LRbQYbglu2A+/YXobSyhiLo9wxUzU 8vXfbB/7o40OoBqdYvgSpNjLyrxV5pcZ32teAVLs= 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: Wed, 08 Mar 2023 18:56: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: 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 --- Comment #37 from Jakub Jelinek --- I've additionally ran #include #include "pr109008-4.c" struct S { float (*fn) (float); float lb, ub; }; struct S arr[] =3D { #include "pr109008-4.h" }; int main () { float plus_inf =3D __builtin_inf (); float minus_inf =3D -plus_inf; for (int i =3D 0; i < sizeof (arr) / sizeof (arr[0]); ++i) { int n1, n2; float lb =3D nextafterf (arr[i].lb, minus_inf); float ub =3D nextafterf (arr[i].ub, plus_inf); if (!__builtin_isnan (arr[i].fn (lb)) || !__builtin_isnan (arr[i].fn (ub))) __builtin_printf ("%p err\n", arr[i].fn); lb =3D arr[i].lb; ub =3D arr[i].ub; for (n1 =3D 0; n1 < 50; n1++) if (!__builtin_isnan (arr[i].fn (lb))) break; else if (lb > ub) { n1 =3D -1; n2 =3D -1; break; } else lb =3D nextafterf (lb, plus_inf); if (n1 !=3D -1) for (n2 =3D 0; n2 < 50; n2++) if (!__builtin_isnan (arr[i].fn (ub))) break; else ub =3D nextafterf (ub, minus_inf); __builtin_printf ("%d %d\n", n1, n2); } } on the header from the #c32+#c33 patches, and ./pr109008-4-main 2>&1 | sort | uniq -c | sort -n 1 1 11 1 11 1 1 1 17 1 1 25 1 1 28 1 1 3 1 1 4 1 19 1 1 2 13 1 2 16 1 2 17 1 2 36 1 2 40 1 3 2 1 39 1 1 5 1 1 5 2 2 1 32 2 1 7 2 3 1 2 3 50 3 4 1 12 50 2 16 2 50 27 50 1 39 1 50 48 32 32 53 33 33 57 17 17 73 16 16 77 8 8 78 9 9 114 4 4 124 5 5 170 3 3 8533 2 2 15203 1 1 24287 50 50 59288 2 1 59613 1 2 130096 -1 -1 The -1 -1 case means that in reality the range is empty (UNDEFINED), there = are no values of eps for which the function returns it, as the difference in exponents is too large for such a number to exist. 50 means actually 50 or more ulps.=