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.129.124]) by sourceware.org (Postfix) with ESMTPS id 3B3D438582B9 for ; Mon, 10 Oct 2022 12:49:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B3D438582B9 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=1665406197; 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=F9I35y2lJDWCo0grR2NNyJylESn3IZFhpP6eUKdgaH0=; b=hUIgdPoSCTDDz+M/+3L94M14dAFA/SEgLyL+qOWx1qwddmo2K6I3E2zmQWgvPK5IrhpXof IsvDyLKrhC7Q+CuBkl37ysqtrOR1AfzS7pm+YbSZOgETptT/9LbzzZFjoAIpPkHu+tGEao SpE3RfWymKQTDBdS9jMG2X+15pHldho= 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-515-pRcXrfBdNI6hK6VX5EJHaQ-1; Mon, 10 Oct 2022 08:49:56 -0400 X-MC-Unique: pRcXrfBdNI6hK6VX5EJHaQ-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 40BBF8432AF for ; Mon, 10 Oct 2022 12:49:56 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.126]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C51A9535939; Mon, 10 Oct 2022 12:49:55 +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 29ACnrGP154182 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 10 Oct 2022 14:49:53 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 29ACnroV154181; Mon, 10 Oct 2022 14:49:53 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] The true side of x != x should set NAN. Date: Mon, 10 Oct 2022 14:49:44 +0200 Message-Id: <20221010124946.154152-3-aldyh@redhat.com> In-Reply-To: <20221010124946.154152-1-aldyh@redhat.com> References: <20221010124946.154152-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=-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 List-Id: gcc/ChangeLog: * range-op-float.cc (foperator_not_equal::op1_range): Set NAN on TRUE side for x != x. --- gcc/range-op-float.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 91833d3f855..5ffe38da53a 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -497,14 +497,17 @@ bool foperator_not_equal::op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind) const + relation_kind rel) const { switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: + // The TRUE side of op1 != op1 implies op1 is NAN. + if (rel == VREL_EQ) + r.set_nan (type); // If the result is true, the only time we know anything is if // OP2 is a constant. - if (op2.singleton_p ()) + else if (op2.singleton_p ()) { // This is correct even if op1 is NAN, because the following // range would be ~[tmp, tmp] with the NAN property set to -- 2.37.3