From patchwork Sat Oct 22 14:25:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 7893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1228855wrr; Sat, 22 Oct 2022 07:26:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7YTNRbO7i8vO7aDkSobrugtIAwLiUtQjZVlIoBRerkCCSzGOIawYWGGgv9Z26M4R0kmpnA X-Received: by 2002:a17:907:6e87:b0:78f:a596:5cf6 with SMTP id sh7-20020a1709076e8700b0078fa5965cf6mr19934354ejc.398.1666448785113; Sat, 22 Oct 2022 07:26:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666448785; cv=none; d=google.com; s=arc-20160816; b=XcofVOjV8w3GTLVf6/K15JBNkhyjsoYDtEz+LhUjtHhs3RCmw3Hkev0aeO7NxgeT0y QOln8/sbsLkdjnfVQroNtHBAtB9DuU9GJ8j6iM0AqXrqq/hTBwtI+r8l+oX+pNg2N33r V+JDjwz9w6eTEc5jmlTYufF09V8B6fSKYEaqgpb15ud6W7/u/nqIIx4Os9jT/OSVljWz DU7Ketlqrn1UT0izvzU4kcqW5cczz/gFMcnUIgPj6aXqvc0J8vfikmUvU4kKwKz0OieC 5Jm3RLPDBeDscIqmlOz/RoNxZ20ZrKpzGO8hERod9Dc6IEss7umnaUjytT/9GBTtfF/J EfPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=udT8LBY81B0axEeGG2gzKDcLE59jntH5GpyTYYW29Yw=; b=b0DL+QZ4thtbNbaPfIQpBmwtUHCeJs78aaiNEoPvb8anah+aKoqhLOsvYv33bNZuid fhaiYg4TM9TNW+qE6edspHJs4tUJvqE1pYBCvREjZEFCgi6lma1glhoqA4FgkHITEVru aYhi/5iKnzyFZmk9kwY9QCjbv5073CKVVx2F34DFy7YjsJEUIge6W6BaKLNak02PEWk/ dWfm+S26z5UTtV9jiOcB5DdL54duUs+lvetuCDzJ+PYyJmJVsU3LRrvymx9r2/hY8L1J M7DRep6rVMQZHWvNQ2Z7qLrjDvXvtmHo7eK2s+oTU7ezuEri7gB8kKMvGnhBeqceniHQ cwHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=dB9064ou; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q6-20020a056402518600b0045981993486si24115831edd.227.2022.10.22.07.26.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 07:26:25 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=dB9064ou; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AED0838582A3 for ; Sat, 22 Oct 2022 14:26:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AED0838582A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666448783; bh=udT8LBY81B0axEeGG2gzKDcLE59jntH5GpyTYYW29Yw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dB9064ouokN4SQ8F8Cpom4sVJYeF2W7B18K1n6lbgF4WRpobyWiaJC6S9qGotuRw9 +iuk/0Mw0IIe+xLxVpQagNJDeaGXPKEDxliE/dgGmPW9PWgqDW+oMlnFBvftn03GNC erf4hV8Ef4wXwSkH9xHR+unzrzSxBxZBSGXJZWNo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 41D003858D1E for ; Sat, 22 Oct 2022 14:25:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 41D003858D1E Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-pYw1tb-2OLqnQxiQUM1p0w-1; Sat, 22 Oct 2022 10:25:34 -0400 X-MC-Unique: pYw1tb-2OLqnQxiQUM1p0w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A05E101A528; Sat, 22 Oct 2022 14:25:34 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F2621121319; Sat, 22 Oct 2022 14:25:34 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 29MEPVBn376433 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 22 Oct 2022 16:25:31 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 29MEPVOp376432; Sat, 22 Oct 2022 16:25:31 +0200 To: GCC patches Subject: [COMMITTED] Update selftest such that [-Inf, +Inf] is always VARYING for -ffinite-math-only. Date: Sat, 22 Oct 2022 16:25:29 +0200 Message-Id: <20221022142529.376406-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747398201389443193?= X-GMAIL-MSGID: =?utf-8?q?1747398201389443193?= [-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. --- 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