Message ID | ZCKdJtsc0vDzPq12@tucnak |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2040754vqo; Tue, 28 Mar 2023 00:55:05 -0700 (PDT) X-Google-Smtp-Source: AKy350aDu+T1kULFJRBwhP/b7xYiGItmyhWOCQAbzHhu3np0eyqTRmDthiuh4XVaHbLtS5HHRQa0 X-Received: by 2002:a17:906:3f8e:b0:939:ad91:adf5 with SMTP id b14-20020a1709063f8e00b00939ad91adf5mr16581448ejj.25.1679990105623; Tue, 28 Mar 2023 00:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679990105; cv=none; d=google.com; s=arc-20160816; b=MDA8VHy8wnctqDixbFqvjt+qajY2LvSQz4wuSKTRbN+jr0qJ/KDaYHw++Nb405BzM8 MxMdb0uHqk9K0NBkfbv8JMhxzG/dPp5yi9ViTEmJaCrnkN7qOEi/1rvnUDLD9tm3DPxG hGTcFEFuRMg9Ro5U1rXK8hVFv3gDXux096HHdsVhJjOWirhstJUTolwAC9RbHu6zyfCc GsyABYmNQNyA0VfHuQpYsAz6MdH85vEU4wsx++bBnS0xhnTlKAAacGtnfgRKnadJUt9l 0VrR6XLdcLlO/d+3hasF8uAAMdx2U9gXsmcmb5EkAWFEnoHqfiftTez7jiHESaT+M9WL j2Qw== 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-disposition:in-reply-to:mime-version:references:message-id :subject:cc:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=hvSQ4xkDwN5YpmoPptLimg5SR6IEa/6CcWGbP0MUBec=; b=TpgxhrxfL95ht0CabAxVJ5HQyF7P8qeBkVDp/Gq0r4BCZezN+5GIgEZNbGU/EyK4/J x7WiRQfyVGWaTW/PM5R5K5YJ7ND5xxnQNekdgCT5Zr872y0GZmc43zPalAnRoCuleRGp w8xcoCWloDK6g4Va0Mia/utfZzb/Omw3CDgtbXgV7fQVmsXe03JIdYL4xfxfiBm9uEzu /6Ywc5J8VV12TZ9cMKURF43GZ7PfV+X7vHRZt1xtiSK7bvXgs5MOePrNJeNbBchWVX2O QgutTfuRzr55AVLBPZX+9YawUHazIBJ7TKPq7kutwpAc2nx+HpW3XoInGcHXPVdJvpRC 64+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=PK7wGVjm; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t21-20020a1709063e5500b0092bdf20dfefsi25997903eji.386.2023.03.28.00.55.05 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 00:55:05 -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=PK7wGVjm; 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 7CC783858417 for <ouuuleilei@gmail.com>; Tue, 28 Mar 2023 07:55:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CC783858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679990104; bh=hvSQ4xkDwN5YpmoPptLimg5SR6IEa/6CcWGbP0MUBec=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=PK7wGVjmVhewGOUJ2jhYCnofQsOkAqCVHDKnt6nOa4QCp41LcoPptRNA/glS5UcMt EFXgfD3DX8mYY6/qT/ffmBrlGvEJa6NhbeZYJOm2MzYSGSvnt8nnpUlU0cGDK6qzr1 bGJ4gCWEJFpNej5D3D6nZ/E9so29w7nLgxE8V2wI= 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 3ECB13858D39 for <gcc-patches@gcc.gnu.org>; Tue, 28 Mar 2023 07:54:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3ECB13858D39 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-212-QeDxiDnAOYiwgfHln5_8ug-1; Tue, 28 Mar 2023 03:54:18 -0400 X-MC-Unique: QeDxiDnAOYiwgfHln5_8ug-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 061343C0D18D for <gcc-patches@gcc.gnu.org>; Tue, 28 Mar 2023 07:54:18 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6F242166B26; Tue, 28 Mar 2023 07:54:17 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 32S7sFYm1441913 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 28 Mar 2023 09:54:15 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 32S7sER81441912; Tue, 28 Mar 2023 09:54:14 +0200 Date: Tue, 28 Mar 2023 09:54:14 +0200 To: Aldy Hernandez <aldyh@redhat.com> Cc: gcc-patches@gcc.gnu.org, Andrew MacLeod <amacleod@redhat.com> Subject: [PATCH] range-op-float: Use get_nan_state in float_widen_lhs_range Message-ID: <ZCKdJtsc0vDzPq12@tucnak> References: <ZArlUJOn1HBZ44yJ@tucnak> <nycvar.YFH.7.77.849.2303100842020.18795@jbgna.fhfr.qr> <1f0427e3-26f5-be76-4cab-5d8ec9ffb988@redhat.com> <ZBmzks4PngpEjq1s@tucnak> <f58bf13e-6e3a-1838-90ae-13e5e005f6ec@redhat.com> <ZBm3jm8DBCJbQwbf@tucnak> <4252dbc5-8b90-c2b7-e736-bc1f1cddfac6@redhat.com> MIME-Version: 1.0 In-Reply-To: <4252dbc5-8b90-c2b7-e736-bc1f1cddfac6@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jakub Jelinek <jakub@redhat.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761597305044151504?= X-GMAIL-MSGID: =?utf-8?q?1761597305044151504?= |
Series |
range-op-float: Use get_nan_state in float_widen_lhs_range
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jakub Jelinek
March 28, 2023, 7:54 a.m. UTC
Hi! On Wed, Mar 22, 2023 at 07:32:44AM +0100, Aldy Hernandez wrote: > * value-range.cc (frange::set): Add nan_state argument. > * value-range.h (class nan_state): New. > (frange::get_nan_state): New. The following patch makes use of those changes in float_widen_lhs_range. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2023-03-28 Jakub Jelinek <jakub@redhat.com> * range-op-float.cc (float_widen_lhs_range): Use pass get_nan_state as 4th argument to set to avoid clear_nan and union_ calls. Jakub
Comments
On 3/28/23 09:54, Jakub Jelinek wrote: > Hi! > > On Wed, Mar 22, 2023 at 07:32:44AM +0100, Aldy Hernandez wrote: >> * value-range.cc (frange::set): Add nan_state argument. >> * value-range.h (class nan_state): New. >> (frange::get_nan_state): New. > > The following patch makes use of those changes in float_widen_lhs_range. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? LGTM. Aldy > > 2023-03-28 Jakub Jelinek <jakub@redhat.com> > > * range-op-float.cc (float_widen_lhs_range): Use pass get_nan_state > as 4th argument to set to avoid clear_nan and union_ calls. > > --- gcc/range-op-float.cc.jj 2023-03-23 15:25:47.119740274 +0100 > +++ gcc/range-op-float.cc 2023-03-27 13:28:18.847264635 +0200 > @@ -2262,12 +2262,7 @@ float_widen_lhs_range (tree type, const > or real_max_representable (type) as upper bound. */ > bool save_flag_finite_math_only = flag_finite_math_only; > flag_finite_math_only = false; > - ret.set (type, lb, ub); > - if (lhs.kind () != VR_VARYING) > - { > - ret.clear_nan (); > - ret.union_ (lhs); > - } > + ret.set (type, lb, ub, lhs.get_nan_state ()); > flag_finite_math_only = save_flag_finite_math_only; > return ret; > } > > > Jakub >
On 3/28/23 10:50, Aldy Hernandez wrote: > > > On 3/28/23 09:54, Jakub Jelinek wrote: >> Hi! >> >> On Wed, Mar 22, 2023 at 07:32:44AM +0100, Aldy Hernandez wrote: >>> * value-range.cc (frange::set): Add nan_state argument. >>> * value-range.h (class nan_state): New. >>> (frange::get_nan_state): New. >> >> The following patch makes use of those changes in float_widen_lhs_range. >> >> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > LGTM. > Aldy >> >> 2023-03-28 Jakub Jelinek <jakub@redhat.com> >> >> * range-op-float.cc (float_widen_lhs_range): Use pass get_nan_state >> as 4th argument to set to avoid clear_nan and union_ calls. >> >> --- gcc/range-op-float.cc.jj 2023-03-23 15:25:47.119740274 +0100 >> +++ gcc/range-op-float.cc 2023-03-27 13:28:18.847264635 +0200 >> @@ -2262,12 +2262,7 @@ float_widen_lhs_range (tree type, const >> or real_max_representable (type) as upper bound. */ >> bool save_flag_finite_math_only = flag_finite_math_only; >> flag_finite_math_only = false; >> - ret.set (type, lb, ub); >> - if (lhs.kind () != VR_VARYING) >> - { >> - ret.clear_nan (); >> - ret.union_ (lhs); >> - } >> + ret.set (type, lb, ub, lhs.get_nan_state ()); >> flag_finite_math_only = save_flag_finite_math_only; >> return ret; I just noticed we're still doing the flag_finite_math_only hack. We should add some sort of flag to the setter to avoid reducing the range. I suppose this can wait to the next release. Aldy
--- gcc/range-op-float.cc.jj 2023-03-23 15:25:47.119740274 +0100 +++ gcc/range-op-float.cc 2023-03-27 13:28:18.847264635 +0200 @@ -2262,12 +2262,7 @@ float_widen_lhs_range (tree type, const or real_max_representable (type) as upper bound. */ bool save_flag_finite_math_only = flag_finite_math_only; flag_finite_math_only = false; - ret.set (type, lb, ub); - if (lhs.kind () != VR_VARYING) - { - ret.clear_nan (); - ret.union_ (lhs); - } + ret.set (type, lb, ub, lhs.get_nan_state ()); flag_finite_math_only = save_flag_finite_math_only; return ret; }