From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666731552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a8GOaOyU1xsICB6BQT7i7NYudbAeQmk6oiWP+Z2piJI=; b=JcPsKxhE5gbPYkDuWF9QV2HfChT6U1voLH1lIB5HfcErOi5T9mO3r7IMHFQvWZiiTfQvvt UGo262j7kGCMLW9BejYce2oWCjkuCHuN7DcMOYCLEmFDpwhQkClivIEqRa5BgWon5xoNan gfdVzOIz+5MKcBya8xF0fgQLkPVf3Ck= 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 From: Aldy Hernandez To: GCC patches Cc: Richard Biener , Andrew MacLeod , Aldy Hernandez 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 List-Id: [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. -- 2.37.3