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 1701C3858D1E for ; Wed, 29 Mar 2023 09:39:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1701C3858D1E 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=1680082750; 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=sW41LrnapVMp3qUNMiffKzWuGheEAjM0QoFEIzod7dI=; b=LZXGY29IYpMEl6wrLL84Bfwpz/vrOE5QBdOWx/qpN3bL4sWs0FzmHeSbxuj9r8bJz8LDXU nNEq/sZKzcGGImz/oDtvvBL7Zm/ss2uuHzzdgwOtAt3w8CR20YXEx9lZbIMF32yE8V28DV IRrVqeIy9hv2FNNtAWFgjdhQEm+lnic= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-155-1151fXY5NfKpM2MhAhnV4g-1; Wed, 29 Mar 2023 05:39:09 -0400 X-MC-Unique: 1151fXY5NfKpM2MhAhnV4g-1 Received: by mail-wr1-f69.google.com with SMTP id bn9-20020a056000060900b002cfe8493fe6so1423290wrb.4 for ; Wed, 29 Mar 2023 02:39:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680082748; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sW41LrnapVMp3qUNMiffKzWuGheEAjM0QoFEIzod7dI=; b=Ios1UDGl4gUS45p0/29fRe3Rf/gwwXMS/N7OGx+XE6ZvzPWnZ1OruWmWxCqqksRoVT 9ET6yR32EF1pRJGsyJQSyu3pnyG51jU0o1d8rCCNPKfWfYoNvpnYeU21RYMoHoI4Pbxb nXEUfzKXUS+ePHbZmmasD3PLraAfKeAnr/wK9JnFk2S2gA9rKEZNSMhcLGCOj2+Hit/T lh2wgCsEfaBzs2jIuFSxIta28ONiHm6kyf735i4eU5ZYws1sAXxc1pUoKvsQ256Q+Dex R4rBzRSjxo+A98crrxY7VYvwrJW7rJsHud/Ay+Z6YxLBRxC1OVQOv+3RbANenoA4t3+T g/NA== X-Gm-Message-State: AAQBX9eaeCRKFzwZXvEMOBoHErakpfS3YTRTHR9s7Ekgd7qUDE+P+auX EJp6cjmesx/YyABXQJSn9W46jpAMBvDP0L/w/B9ZnV3OCSGzWk28cH1zGZyc66ZkfVQpg47TWE+ YvP5T5TkOnkf9Jr+NJg== X-Received: by 2002:a05:600c:ad6:b0:3ef:76dc:4b80 with SMTP id c22-20020a05600c0ad600b003ef76dc4b80mr4941063wmr.9.1680082748465; Wed, 29 Mar 2023 02:39:08 -0700 (PDT) X-Google-Smtp-Source: AKy350ay4qVM2zXLTVNnSNHKi5URsR2YJB3wZcCNFi9sVomXB4RCP61nOTrk2o1T6R9nobX5nfgzbQ== X-Received: by 2002:a05:600c:ad6:b0:3ef:76dc:4b80 with SMTP id c22-20020a05600c0ad600b003ef76dc4b80mr4941052wmr.9.1680082748182; Wed, 29 Mar 2023 02:39:08 -0700 (PDT) Received: from [192.168.64.213] ([31.221.156.186]) by smtp.gmail.com with ESMTPSA id r14-20020a05600c458e00b003ef6ceedf14sm1636693wmo.38.2023.03.29.02.39.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Mar 2023 02:39:07 -0700 (PDT) Message-ID: <89a8cbeb-c4c7-fa46-aaff-7254e16ea9dc@redhat.com> Date: Wed, 29 Mar 2023 11:39:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] range-op-float: Use get_nan_state in float_widen_lhs_range From: Aldy Hernandez To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, Andrew MacLeod References: <1f0427e3-26f5-be76-4cab-5d8ec9ffb988@redhat.com> <4252dbc5-8b90-c2b7-e736-bc1f1cddfac6@redhat.com> In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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: 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  >> >>     * 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