From patchwork Tue Oct 25 20:59:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1694634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=sxV+ZQ5b; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MxkpL2ZHXz23kc for ; Wed, 26 Oct 2022 07:59:37 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1C3883856DF2 for ; Tue, 25 Oct 2022 20:59:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C3883856DF2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666731573; bh=a8GOaOyU1xsICB6BQT7i7NYudbAeQmk6oiWP+Z2piJI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=sxV+ZQ5bgxL2WLAPR0ugU0oPVNxhuI007wzLMeLk2k0ZnEVreuqrXaS/9ma2RGexi xBbLMBteo+oovcUbo9UA6d/OaE9RWRsb93VrYifOtqwX2Rg4+FTIfFi+T5WHJ9Rget 37zApZzmch7QjqTeTkHMzupZTiRscShBXkPwEdSc= 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 A3AD33857008 for ; Tue, 25 Oct 2022 20:59:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A3AD33857008 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-542-8SArr4ihNxqpVVmvBfIuQg-1; Tue, 25 Oct 2022 16:59:08 -0400 X-MC-Unique: 8SArr4ihNxqpVVmvBfIuQg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C6BF85A583; Tue, 25 Oct 2022 20:59:08 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.78]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB56340C2064; Tue, 25 Oct 2022 20:59:07 +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 29PKx4cu125088 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 25 Oct 2022 22:59:04 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 29PKx47l125087; Tue, 25 Oct 2022 22:59:04 +0200 To: GCC patches Subject: [PATCH] Convert flag_finite_math_only uses in frange to HONOR_*. Date: Tue, 25 Oct 2022 22:59:01 +0200 Message-Id: <20221025205901.125058-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.6 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" [As Richi, and probably Jakub, have mentioned in the past...] As mentioned earlier, we should be using HONOR_* on types rather than flag_finite_math_only. Will commit pending tests. gcc/ChangeLog: * value-range.cc (frange::set): Use HONOR_*. (frange::verify_range): Same. * value-range.h (frange_val_min): Same. (frange_val_max): Same. --- gcc/value-range.cc | 6 +++--- gcc/value-range.h | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index d8ee6ec0d0f..77e5a2cc299 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -341,7 +341,7 @@ frange::set (tree type, // For -ffinite-math-only we can drop ranges outside the // representable numbers to min/max for the type. - if (flag_finite_math_only) + if (!HONOR_INFINITIES (m_type)) { REAL_VALUE_TYPE min_repr = frange_val_min (m_type); REAL_VALUE_TYPE max_repr = frange_val_max (m_type); @@ -712,8 +712,8 @@ frange::supports_type_p (const_tree type) const void frange::verify_range () { - if (flag_finite_math_only) - gcc_checking_assert (!maybe_isnan ()); + if (!undefined_p ()) + gcc_checking_assert (HONOR_NANS (m_type) || !maybe_isnan ()); switch (m_kind) { case VR_UNDEFINED: diff --git a/gcc/value-range.h b/gcc/value-range.h index b48542a68aa..c87734dd8cd 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -1201,10 +1201,10 @@ real_min_representable (const_tree type) inline REAL_VALUE_TYPE frange_val_min (const_tree type) { - if (flag_finite_math_only) - return real_min_representable (type); - else + if (HONOR_INFINITIES (type)) return dconstninf; + else + return real_min_representable (type); } // Return the maximum value for TYPE. @@ -1212,10 +1212,10 @@ frange_val_min (const_tree type) inline REAL_VALUE_TYPE frange_val_max (const_tree type) { - if (flag_finite_math_only) - return real_max_representable (type); - else + if (HONOR_INFINITIES (type)) return dconstinf; + else + return real_max_representable (type); } // Return TRUE if R is the minimum value for TYPE.