From patchwork Thu Sep 22 18:59:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 57927 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A99683858017 for ; Thu, 22 Sep 2022 18:59:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A99683858017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663873196; bh=8O/pu2z+HCoJ09fyjwSJ+QkjB9sKIptGthJccMVpsFw=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=NPub/CYC90pwT4Ke9dhRFEIDCQfPjrJgmaY8ukdIap5tm2ONmJm9bWd/z9K12Cvau zPfaKKazi95dZG/IlUlyykF/iIAEotPVZDOpBTCCEb2ppcx5gi+tmN32JnqpciBIBi ULzt7ZYqc3kCaZV3R67jm2Fu9pFnNovuKGi6YRz0= 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 334253858D38 for ; Thu, 22 Sep 2022 18:59:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 334253858D38 Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-208-MM4-4DcUNey1gOJv-dK1rw-1; Thu, 22 Sep 2022 14:59:25 -0400 X-MC-Unique: MM4-4DcUNey1gOJv-dK1rw-1 Received: by mail-il1-f200.google.com with SMTP id x14-20020a056e021cae00b002f1d5aca8c6so6189443ill.5 for ; Thu, 22 Sep 2022 11:59:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:cc:to:from:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date; bh=fHXmkP1Yf6lby4J0qDdJ7NpbCdWLEKhr4JWy9B+I/bE=; b=1n2xxM8aaDs4BLGabyVZNryO+obcpz0mIGH5JB3gJ5teDnzota3x6wRBABpaEeomf9 ZV+8/swS72GvKMlau0uCt3JxUsiJkekjRsi4c1oziYEbu1Ny49CpRx0aSKlnFBb99KDf LGkpvigFnD9kmEskB1aD0ISvyAGWa5Qw39bJ+ZrL2q49UqJwSDDbRcGGQvN4Z+02aZnr SUbYlhXrFkD1J/BcHyDtZiaGK0F37kNJHsS0exD3V/AJl4Wz5T6wXIgUVbUTp/aPux0W R4GnCG59A/k4izZ+q9MaBYzD/Q+l3R+zgv5OVwzvxY7bExmabqUHRgPjjLmuBqoYyjqJ p5ow== X-Gm-Message-State: ACrzQf1ioT2tmcHOezN/Nqk8IArnRP49/rO4y42HKhcxZMZrEkTc2kGY Hnpijnsjy+W2FUEWiSIeTlwIhipXXjVTWojpKlmH3Ufz6+UC/5v2314KUkPhhh0xcCtRP4QGavG Odhs+17QtGPXZPNus+1jxaZtfA7TnfaDSXnj9qTxn34XM24jXY4WjUw6psj9rtpcYId+Tgw== X-Received: by 2002:a05:6e02:1c2d:b0:2f6:572b:1931 with SMTP id m13-20020a056e021c2d00b002f6572b1931mr2443997ilh.209.1663873164537; Thu, 22 Sep 2022 11:59:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4rQCQgt+xIvnzcprDF3TtNCdd/dv05Cci1oLb4gAAwYonKs55Y7H0LKuestfS4qBE2r4rGIg== X-Received: by 2002:a05:6e02:1c2d:b0:2f6:572b:1931 with SMTP id m13-20020a056e021c2d00b002f6572b1931mr2443986ilh.209.1663873164261; Thu, 22 Sep 2022 11:59:24 -0700 (PDT) Received: from ?IPV6:2607:fea8:a263:f600::3dbe? ([2607:fea8:a263:f600::3dbe]) by smtp.gmail.com with ESMTPSA id t1-20020a028781000000b003428c21ed12sm2502209jai.167.2022.09.22.11.59.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Sep 2022 11:59:23 -0700 (PDT) Message-ID: <78509fb2-e386-0cbe-db5f-abca5cfe48f6@redhat.com> Date: Thu, 22 Sep 2022 14:59:22 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: [PATCH 05/17] Add missing float fold_range prototype for floats. To: gcc-patches References: <571782f9-72e6-5c30-da55-b8d62d3a153e@redhat.com> In-Reply-To: <571782f9-72e6-5c30-da55-b8d62d3a153e@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-12.5 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: Andrew MacLeod via Gcc-patches From: Andrew MacLeod Reply-To: Andrew MacLeod Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Unary operations require op2 to be the range of the type of the LHS. This is so the type for the LHS can be properly set.  There are is a missing prototype for this combination. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From be2a25adbdc76a770f7470cc9f47892f7a4139ae Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 20 Sep 2022 12:34:08 -0400 Subject: [PATCH 05/17] Add missing float fold_range prototype for floats. Unary operations require op2 to be the range of the type of the LHS. This is so the type for the LHS can be properly set. * range-op-float.cc (range_operator_float::fold_range): New base method for "int = float op int". * range-op.cc (range_op_handler::fold_range): New case. * range-op.h: Update prototypes. --- gcc/range-op-float.cc | 10 ++++++++++ gcc/range-op.cc | 13 ++++++++++--- gcc/range-op.h | 5 +++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 2bd3dc9253f..aa5b7ed073d 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -58,6 +58,16 @@ range_operator_float::fold_range (frange &r ATTRIBUTE_UNUSED, return false; } +bool +range_operator_float::fold_range (irange &r ATTRIBUTE_UNUSED, + tree type ATTRIBUTE_UNUSED, + const frange &lh ATTRIBUTE_UNUSED, + const irange &rh ATTRIBUTE_UNUSED, + relation_kind rel ATTRIBUTE_UNUSED) const +{ + return false; +} + bool range_operator_float::fold_range (irange &r ATTRIBUTE_UNUSED, tree type ATTRIBUTE_UNUSED, diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 9ae42b8331f..072ebd32109 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -4208,9 +4208,16 @@ range_op_handler::fold_range (vrange &r, tree type, as_a (rh), rel); if (is_a (r)) - return m_float->fold_range (as_a (r), type, - as_a (lh), - as_a (rh), rel); + { + if (is_a (rh)) + return m_float->fold_range (as_a (r), type, + as_a (lh), + as_a (rh), rel); + else + return m_float->fold_range (as_a (r), type, + as_a (lh), + as_a (rh), rel); + } return m_float->fold_range (as_a (r), type, as_a (lh), as_a (rh), rel); diff --git a/gcc/range-op.h b/gcc/range-op.h index b4b5101a9e0..b2f063afb07 100644 --- a/gcc/range-op.h +++ b/gcc/range-op.h @@ -117,6 +117,11 @@ public: const frange &lh, const frange &rh, relation_kind rel = VREL_VARYING) const; + // Unary operations have the range of the LHS as op2. + virtual bool fold_range (irange &r, tree type, + const frange &lh, + const irange &rh, + relation_kind rel = VREL_VARYING) const; virtual bool fold_range (irange &r, tree type, const frange &lh, const frange &rh, -- 2.37.3