From patchwork Tue Sep 20 18:22:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1322 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp1589630wrt; Tue, 20 Sep 2022 11:23:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Cq0sKiQwuOb0Kj6v20MwKeHaQQvmEZcFtg3RiR3PoeNibDMLgX6Waed5/GpNnAzGGYtBe X-Received: by 2002:a17:907:e8c:b0:773:69e4:de06 with SMTP id ho12-20020a1709070e8c00b0077369e4de06mr18213781ejc.423.1663698212397; Tue, 20 Sep 2022 11:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663698212; cv=none; d=google.com; s=arc-20160816; b=DLNLIzN5znScZSq0UQIx1YY0cwj3R5eISACXFoo9c0axoX5iH4tzHpDl+dl6q6pvYx puUKaAftzTykK13PDy5htvs+z6+AHD5ty1ruj6OpXnga1gFHNI1wsUcyHPB72dBdGHWg huKsEaBMfP8JIpua04LvN+OLVOej0CT9QUGOg0fokJQezoj1AJPXL3g+0lnH9OjlzYUn NZOqVCwA/BKfr3zcRljoEjsLNmcHIZDnhKeoat8cXnZI99zv6jbXmMN+CihSpZv8jH9t BuoZ4s4BAsDzP/QIvM+jW5jG0l0/ER2SeD2c9oUfj4iRxw0jR8IGllEm5zCxyYA5SdQj Oezg== 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=nIRAiWTsH5PifsBltZzZg0hLlbU9YeQmvRxJ+FD5xyg=; b=0oE6VXrHZQyCEmzIVRLYNifV84TEcZ+40Oa3ooNdeqf70l/vP2Ppw7FJqW5EqSr1F+ LeaV2AgFcP/tYdtXBsuEPofW4KLoLp5ie2yvPWc1e6IjW1gT7LCaWFc2S8bH1kzL2cbX fVibtuXqVbrpqJpt4WaHh/jddrTx08uC9WNBtXttqXxqdYV0yOdp7zyD0drzwHHX74V0 YOnKGbj4vcLQ3jPwrT08qYl7JsRvrus31ceOsNd/9oJEJtORLyUVUwmofL0vRWGzSmXO 0W8Qey5OC9IsPmhVRO0dqaUoIXfjzC4Qmlv0FX87X2gOWwmaB/V62TvYO8yvEKjKfoEI sxGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=LEqBufdw; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id jo5-20020a170906f6c500b0078198611a45si261157ejb.980.2022.09.20.11.23.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 11:23:32 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=LEqBufdw; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 74BBD3858284 for ; Tue, 20 Sep 2022 18:23:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74BBD3858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663698211; bh=nIRAiWTsH5PifsBltZzZg0hLlbU9YeQmvRxJ+FD5xyg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=LEqBufdw03ByS71TcTsJl1KcCp2439kpV9RN5R9ePdWqAL5j+fBCcxP3BasEXbG5P ih50RY2S49/PYDeAV6LmII6gmQ9T1rMGohlvEkrdQ1VcOQ41KmgM8Jd/5xTIqHYtPr WZ+3h6wkQOzpJ5gnMnyi0aEqP6tGqwfDvxaGp4C8= 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.129.124]) by sourceware.org (Postfix) with ESMTPS id A81EE3858C55 for ; Tue, 20 Sep 2022 18:22:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A81EE3858C55 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-281-7VIrwec_NsKya8ubWm2dWg-1; Tue, 20 Sep 2022 14:22:45 -0400 X-MC-Unique: 7VIrwec_NsKya8ubWm2dWg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B6235811E81 for ; Tue, 20 Sep 2022 18:22:44 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.194.181]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 64B9D2166B26; Tue, 20 Sep 2022 18:22:44 +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 28KIMfHP2019659 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 20 Sep 2022 20:22:41 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 28KIMfiN2019658; Tue, 20 Sep 2022 20:22:41 +0200 To: GCC patches Subject: [COMMITTED] frange::maybe_isnan() should return FALSE for undefined ranges. Date: Tue, 20 Sep 2022 20:22:24 +0200 Message-Id: <20220920182223.2019637-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 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_LOW, 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?1744514017203440849?= X-GMAIL-MSGID: =?utf-8?q?1744514017203440849?= Undefined ranges have undefined NAN bits. We can't depend on them, as they may contain garbage. This patch returns false from maybe_isnan() for undefined ranges (the empty set). gcc/ChangeLog: * value-range.h (frange::maybe_isnan): Return false for undefined ranges. --- gcc/value-range.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/value-range.h b/gcc/value-range.h index 7d5584a9294..325ed08f290 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -1210,6 +1210,8 @@ frange::known_isinf () const inline bool frange::maybe_isnan () const { + if (undefined_p ()) + return false; return m_pos_nan || m_neg_nan; }