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 429993858291 for ; Sun, 13 Nov 2022 18:49:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 429993858291 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=1668365356; 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: in-reply-to:in-reply-to:references:references; bh=lSofrY65sEs4mLcyKMXzwx3hRT++jFPhbE+xFT01NT0=; b=RnwsxqCJdoceBz3GrQa5oQLYn9bd9XmXl1UbPmpG/sFDCU8KqWpIXJjNc/ozu06wwq7bFi yHuG47oIhqECw+nDqsIYsOTdVWNnL4NdnAD6FAoldeTJCrKpnA0usYZsLKL9mQy4Em+uno EJv3PIKrd9jyDzD44erIehsWzn2hW7Q= Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-327-AvwAA9mhMyyIKoqev6hHLg-1; Sun, 13 Nov 2022 13:49:15 -0500 X-MC-Unique: AvwAA9mhMyyIKoqev6hHLg-1 Received: by mail-yb1-f200.google.com with SMTP id j132-20020a25238a000000b006da635e2073so8714503ybj.2 for ; Sun, 13 Nov 2022 10:49:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lSofrY65sEs4mLcyKMXzwx3hRT++jFPhbE+xFT01NT0=; b=D/hFaUvFe5a7e6orb+3nFzDYIdzSUmpLGcdQWzP+sz3YWYcy6+Uy4412JgKVUKbKQ6 5yuqGZE/SUPCQN7bE7b4DXJXG8hjRn9gU6FTOJCYRJ+y8BZdXMA00W0J75G453iz+r8E AMH2k+zIbORXlg5FAMMd9SL9LlOAFwla7LB4/VqFoSWR/Kg4svWYhvdMd73j/W3GAJRq GAha5HqCPOWZVNIqu5fgNXiiRS3WTlI6xAC4PpsscCYfwQ3JdJ+oZUaqJH82IWEsz0Eu vhBYM54o9762cmASim4fI11Fep5Kz8/9FZfpBSwrSVZfQ0jSPUwN/sRyJaTYLXh3T/Ig x+wA== X-Gm-Message-State: ANoB5pm7C+8YmFxcS47mkGgiCU4SMLncmOT0aNPg54nXKYrB5efC91UH QbFKBLrEDHZtsjC69GEi/DIDFePG2JnY3Gy+6ZwZrnQRsASg2ZoUM4toBIhy+ioXVO/V7C6pB2k cOZfRq1qyAdh+yeMFzZFhy/A= X-Received: by 2002:a81:9951:0:b0:37c:8e96:34a0 with SMTP id q78-20020a819951000000b0037c8e9634a0mr8133301ywg.444.1668365355079; Sun, 13 Nov 2022 10:49:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf7tF3CQbO0Gu83kHHqmechvuyaSRpIENzdUW2rwLxH6Gk3fOOt+3eBlV92aepGntGjEoxTCoUg3KAvTY+h2WME= X-Received: by 2002:a81:9951:0:b0:37c:8e96:34a0 with SMTP id q78-20020a819951000000b0037c8e9634a0mr8133293ywg.444.1668365354820; Sun, 13 Nov 2022 10:49:14 -0800 (PST) MIME-Version: 1.0 References: <2afa474d-79a0-c978-f881-bd71f8016585@redhat.com> In-Reply-To: <2afa474d-79a0-c978-f881-bd71f8016585@redhat.com> From: Aldy Hernandez Date: Sun, 13 Nov 2022 19:49:04 +0100 Message-ID: Subject: Re: are most floating point cases in tree_call_nonnegative_warnv_p() wrong for HONOR_NANS? To: Jakub Jelinek Cc: gcc@gcc.gnu.org, amacleod@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-5.5 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 List-Id: I suppose most of the calls to tree_expr_nonnegative_p that apply to floats in match.pd and tree-ssa-math-opts.cc are guarded by !HONOR_NANS || tree_expr_nonnegative_p. Still feels kinda delicate... Aldy On Sun, Nov 13, 2022 at 4:56 PM Aldy Hernandez wrote: > > Based on discussions in the last few weeks, aren't most of the cases in > tree_call_nonnegative_warnv_p() wrong when honoring NANS? > > For example: > CASE_CFN_ACOS: > CASE_CFN_ACOS_FN: > CASE_CFN_ACOSH: > CASE_CFN_ACOSH_FN: > ... > ... > /* Always true. */ > return true; > > But are we guaranteed a +NAN for any NAN input? I thought we were only > guaranteed the NAN sign for abs, copysign, assignment, etc? Similarly > for most other cases in this function. > > Hmmm. I really think a good chunk of fold-const.cc should live in > range-ops. It seems we're duplicating a lot of functionality. > Similarly to bit-CCP as I've mentioned. > > Aldy