From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2136) id 60B0B3858285; Sat, 22 Oct 2022 14:26:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60B0B3858285 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666448786; bh=BaumVvIgdyrBs89ka8ZctSKFIw/B2JpUjWf8k//b4IY=; h=From:To:Subject:Date:From; b=hwIWPO1Yx32niVZr2Lft0612q7b22fySZ7jPRJ0BZIP4k8bm+XlMUFgLjBeonXm85 BZc1DSpkCjyeNgw6bFAKJpfHHWOJ1tlM4bgPM47eEOnIDSykyC6XSPSC8QsfKEWoYY vqpGu9Nt+wHX8tS+A2OLcdLM5sA+sKaBnEokNGU8= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Aldy Hernandez To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3443] Update selftest such that [-Inf, +Inf] is always VARYING for -ffinite-math-only. X-Act-Checkin: gcc X-Git-Author: Aldy Hernandez X-Git-Refname: refs/heads/master X-Git-Oldrev: e0927d7ddca154b1a5151da698e205593cb8912e X-Git-Newrev: 423df44a090846b9c59650efb11745f07914f1d5 Message-Id: <20221022142626.60B0B3858285@sourceware.org> Date: Sat, 22 Oct 2022 14:26:25 +0000 (GMT) List-Id: https://gcc.gnu.org/g:423df44a090846b9c59650efb11745f07914f1d5 commit r13-3443-g423df44a090846b9c59650efb11745f07914f1d5 Author: Aldy Hernandez Date: Sat Oct 22 16:22:50 2022 +0200 Update selftest such that [-Inf, +Inf] is always VARYING for -ffinite-math-only. [-Inf, +Inf] +-NAN gets normalized as VARYING. There is a test that drops the NAN possibility, and tests that the range is no longer VARYING but [-Inf, +Inf]. However, for -ffinite-math-only targets (Vax, RX, etc) the range would still be VARYING because the VARYING range never had a NAN to begin with. This fixes the test. I have a precommit hook that does self-tests with -fno-finite-math-only, -ffinite-math-only, and -ffast-math as a sanity check, but my precommit hook last week was disabled because there was a tree-ssa.exp in mainline failing which was throwing off my scripts. My apologies. gcc/ChangeLog: * value-range.cc (range_tests_floats): Predicate [-Inf, +Inf] test with !flag_finite_math_only. Diff: --- gcc/value-range.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index bcda4987307..d779e9819e2 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -3960,8 +3960,11 @@ range_tests_floats () if (r0.maybe_isnan ()) ASSERT_TRUE (r0.varying_p ()); // ...unless it has some special property... - r0.clear_nan (); - ASSERT_FALSE (r0.varying_p ()); + if (!flag_finite_math_only) + { + r0.clear_nan (); + ASSERT_FALSE (r0.varying_p ()); + } // For most architectures, where float and double are different // sizes, having the same endpoints does not necessarily mean the