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 6B5E338582B7 for ; Fri, 14 Oct 2022 14:27:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6B5E338582B7 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=1665757621; 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: in-reply-to:in-reply-to:references:references; bh=1/XQHtA10jtkJqjhlASQ9818Y1+XDRwnpN6gkiVObi0=; b=BVUDPvCrpnXssjwoy74g9wVpiV4TbIZ3nBGjpCuf/ug0/38mhwSLILAySJ4cTVMziwJxLP pNpQlJZsxuCsaY/brI0wTixZ32XKxodLGwNMuckCnOScyIp/HPtkl58NyK080TvWTPOHIR zHCJ62GHeUN3DdFxhzmvuPdggydL0qI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-sEy8cTLQOC6HuHjkPxpXQQ-1; Fri, 14 Oct 2022 10:26:59 -0400 X-MC-Unique: sEy8cTLQOC6HuHjkPxpXQQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4D8F380673F for ; Fri, 14 Oct 2022 14:26:59 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.195.163]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E36B416361; Fri, 14 Oct 2022 14:26:59 +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 29EEQvX9671512 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 14 Oct 2022 16:26:57 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 29EEQv2d671511; Fri, 14 Oct 2022 16:26:57 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] Normalize ranges over the range for both bounds when -ffinite-math-only. Date: Fri, 14 Oct 2022 16:26:51 +0200 Message-Id: <20221014142652.671475-2-aldyh@redhat.com> In-Reply-To: <20221014142652.671475-1-aldyh@redhat.com> References: <20221014142652.671475-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=-12.0 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,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: [-Inf, +Inf] was being chopped correctly for -ffinite-math-only, but [-Inf, -Inf] was not. This was latent because a bug in real_isdenormal is causing us to flush -Inf to zero. gcc/ChangeLog: * value-range.cc (frange::set): Normalize ranges for both bounds. --- gcc/value-range.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 86550f158b8..6b4f3dddcd5 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -340,8 +340,12 @@ frange::set (tree type, REAL_VALUE_TYPE max_repr = frange_val_max (m_type); if (real_less (&m_min, &min_repr)) m_min = min_repr; + else if (real_less (&max_repr, &m_min)) + m_min = max_repr; if (real_less (&max_repr, &m_max)) m_max = max_repr; + else if (real_less (&m_max, &min_repr)) + m_max = min_repr; } // Check for swapped ranges. -- 2.37.3