From patchwork Thu Oct 6 06:23:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1755 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp166480wrs; Wed, 5 Oct 2022 23:25:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BvzwudU6bXrCP1Ub3vADHKznfqBWkBaO2dU1Ywmo1Aqo8+GTt+Mc2NsDBMjR19JDlqMHg X-Received: by 2002:a05:6402:c45:b0:442:c549:8e6b with SMTP id cs5-20020a0564020c4500b00442c5498e6bmr3123190edb.123.1665037506455; Wed, 05 Oct 2022 23:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665037506; cv=none; d=google.com; s=arc-20160816; b=Igo5Phbo2PHIpNq3SUAyGcYyweIKDXxHU1N8mn7WFQce4Gh0uoEqcoanf+47muM5Hw 9HWNbA47NWpmZ6SdoAJe7vG9/YhyIfVb3mqNKeKeVfADTKt2g4wIMOMW4kliG9Wocr8w mi2+YlWEop2I+lqdlZqifGERJZWOocbsQGg6QEQPDIM9kYpnTetDpUSO+UikaCRg2nhD KZvkGjBl5kxGG+hzCDSOBO/9cOd3AcpSIdVWZDZ1nLKPAluyP9ylcW6G7M/tDKx736H0 eIJqqcP0l7EjZLIIpt67DVRs0imls23HbPaD21JOzsDzTNN7Dw7/m5jTSpLgZmwA8qve wUWQ== 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:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=48XC7k3tbfWgruN+j5eo2C5yu5z/IH5fZF3x37Fx2f8=; b=MZJCQnpANNk/JGlNOPusCCoFWmsdTgEgx/+QrAmi4JJEBNrnVQ/409jdg3rPvCutg7 vV+S23GMF/zy5Z6T5AS0nlOBHfIMouzUafe5QIHJ1OdYi61kNWgYsnnK770Z6hZ2D+OJ VQa1RAvhvpCRUc6dU8lBpB51XP8UKwktC2s8ppfWgmkAPwqjcYCSF1CHkFcNTk7Sp1sG 5Jy3jUj2D16zm5fg+/4imq2NQKxgXUZU4ZDVWfZ3JCkdE/1Pn+0L7SD2QfrI0vGSH7Sn X996R6NA5xFeg7+IiImGUmx0STWKCSsfhH3aNQL3eVygHBkCt+Q22ibodn3LhY8IDBcP 3zQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KofXbcYK; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id w16-20020a05640234d000b00459d4df7a4esi1564386edc.265.2022.10.05.23.25.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 23:25:06 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KofXbcYK; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 0BFE4384D17B for ; Thu, 6 Oct 2022 06:25:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BFE4384D17B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665037505; bh=48XC7k3tbfWgruN+j5eo2C5yu5z/IH5fZF3x37Fx2f8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=KofXbcYKgQHTopWKsE/nTD7LN9TPVC+GgwtC6R4ngqZQUZQxphvAKJWDMhgxKPXyl uOEXhmE8rHwtpFJL1Yi7BiQdaqfrXaz0UcES6A+XFynH4N0PvlMm/pnI1jZLK+tCC/ /XZ0vkKU1oB8OioRWFWEesMTnoxmR0Gxmb+/7cxI= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 465B0384D16C for ; Thu, 6 Oct 2022 06:23:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 465B0384D16C 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-260-BeCir72WOJ-tbmd2Rt1VCQ-1; Thu, 06 Oct 2022 02:23:23 -0400 X-MC-Unique: BeCir72WOJ-tbmd2Rt1VCQ-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 DAB4880206D for ; Thu, 6 Oct 2022 06:23:22 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.138]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71F902166B26; Thu, 6 Oct 2022 06:23:22 +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 2966NKk21710018 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 6 Oct 2022 08:23:20 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 2966NKl21710017; Thu, 6 Oct 2022 08:23:20 +0200 To: GCC patches Subject: [COMMITTED] Do not check finite_operands_p twice in range-ops-float. Date: Thu, 6 Oct 2022 08:23:17 +0200 Message-Id: <20221006062318.1709996-2-aldyh@redhat.com> In-Reply-To: <20221006062318.1709996-1-aldyh@redhat.com> References: <20221006062318.1709996-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.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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?1745918367969575072?= X-GMAIL-MSGID: =?utf-8?q?1745918367969575072?= The uses of finite_operands_p removed are guarded by a call to finite_operands_p already. gcc/ChangeLog: * range-op-float.cc (foperator_lt::fold_range): Remove extra check to finite_operands_p. (foperator_le::fold_range): Same. (foperator_gt::fold_range): Same. (foperator_ge::fold_range): Same. --- gcc/range-op-float.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 6e9d51d3b4b..68578aa6fe7 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -572,8 +572,7 @@ foperator_lt::fold_range (irange &r, tree type, { if (real_less (&op1.upper_bound (), &op2.lower_bound ())) r = range_true (type); - else if (finite_operands_p (op1, op2) - && !real_less (&op1.lower_bound (), &op2.upper_bound ())) + else if (!real_less (&op1.lower_bound (), &op2.upper_bound ())) r = range_false (type); else r = range_true_and_false (type); @@ -688,8 +687,7 @@ foperator_le::fold_range (irange &r, tree type, { if (real_compare (LE_EXPR, &op1.upper_bound (), &op2.lower_bound ())) r = range_true (type); - else if (finite_operands_p (op1, op2) - && !real_compare (LE_EXPR, &op1.lower_bound (), &op2.upper_bound ())) + else if (!real_compare (LE_EXPR, &op1.lower_bound (), &op2.upper_bound ())) r = range_false (type); else r = range_true_and_false (type); @@ -796,8 +794,7 @@ foperator_gt::fold_range (irange &r, tree type, { if (real_compare (GT_EXPR, &op1.lower_bound (), &op2.upper_bound ())) r = range_true (type); - else if (finite_operands_p (op1, op2) - && !real_compare (GT_EXPR, &op1.upper_bound (), &op2.lower_bound ())) + else if (!real_compare (GT_EXPR, &op1.upper_bound (), &op2.lower_bound ())) r = range_false (type); else r = range_true_and_false (type); @@ -912,8 +909,7 @@ foperator_ge::fold_range (irange &r, tree type, { if (real_compare (GE_EXPR, &op1.lower_bound (), &op2.upper_bound ())) r = range_true (type); - else if (finite_operands_p (op1, op2) - && !real_compare (GE_EXPR, &op1.upper_bound (), &op2.lower_bound ())) + else if (!real_compare (GE_EXPR, &op1.upper_bound (), &op2.lower_bound ())) r = range_false (type); else r = range_true_and_false (type);