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 093563898C75 for ; Tue, 15 Nov 2022 16:31:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 093563898C75 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=1668529905; 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=tpIEMEFZhKEhic74mSIFUzTzf/1CvyCv3l3ewwLuzB4=; b=PA/CiW4xTYKJ9mOygGEsyJMHWgWexaWC+pv0OZw9ZexDYwER2YBDb0bqc/ObsyGkaIY+r0 V/vteCBJZjUNHkjTIJt8dxZOv1A2LKVh2XayxJQPpM4PwBj2jntDzlU6+PgKXVdJsD5e+H IUkCsWWA5QIzb+0Du+UHoJYTJsVapnY= 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-170-MkYQaikRPXmNn_9_qR0hdA-1; Tue, 15 Nov 2022 11:31:44 -0500 X-MC-Unique: MkYQaikRPXmNn_9_qR0hdA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 391991C05AC3 for ; Tue, 15 Nov 2022 16:31:44 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.195.161]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C648F39D6A; Tue, 15 Nov 2022 16:31:43 +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 2AFGVdWh604266 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 15 Nov 2022 17:31:39 +0100 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 2AFGVd1L604265; Tue, 15 Nov 2022 17:31:39 +0100 From: Aldy Hernandez To: Jakub Jelinek Cc: GCC patches , Andrew MacLeod , Aldy Hernandez Subject: [PATCH] [range-ops] Minor readability fix. Date: Tue, 15 Nov 2022 17:31:35 +0100 Message-Id: <20221115163135.604240-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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_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: I know it's past the end of stage1, but I'm afraid we'll drag this around forever in the GCC12 branch, and it's an easy readbility fix. p.s. Or if you prefer: if (!lb_nan && !ub_nan && !maybe_nan && ....) r.clear_nan (); OK for trunk? gcc/ChangeLog: * range-op-float.cc (range_operator_float::fold_range): Make check for maybe_isnan more readable. --- gcc/range-op-float.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 53a0928c6aa..86107e16553 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -83,10 +83,12 @@ range_operator_float::fold_range (frange &r, tree type, r.set (type, lb, ub); - if (lb_nan || ub_nan || maybe_nan) + if (lb_nan || ub_nan || maybe_nan + || op1.maybe_isnan () + || op2.maybe_isnan ()) // Keep the default NAN (with a varying sign) set by the setter. ; - else if (!op1.maybe_isnan () && !op2.maybe_isnan ()) + else r.clear_nan (); return true; -- 2.38.1