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 9C6BE384F6C9 for ; Fri, 18 Nov 2022 10:44:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9C6BE384F6C9 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=1668768298; h=from:from:reply-to: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=zt+MOQ1jtUawr2wyJczUrM5RyZ73Hz8PO9+zHaPaidA=; b=BNQoitbZBY2pOzf/m0ADp+2x1KGVZ1aotviXmAjCX7228DW94J9i7o1fybJA/QnhpVo1r6 rEgYfWBIu1frbp3hl+CxXL9Ha92XsqkryPaN3NUYLfevEe/Tap1nOsEYsB4j52mweB5WA7 UWHxAFUfE3N9LEB40+fGIcNI/4z1wDo= 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-551-a4L7qzI3MAKCnsxi6G8uaw-1; Fri, 18 Nov 2022 05:44:53 -0500 X-MC-Unique: a4L7qzI3MAKCnsxi6G8uaw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 742F18001B8; Fri, 18 Nov 2022 10:44:53 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 173E249BB60; Fri, 18 Nov 2022 10:44:52 +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 2AIAilPB1897565 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 18 Nov 2022 11:44:48 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2AIAikbo1897564; Fri, 18 Nov 2022 11:44:46 +0100 Date: Fri, 18 Nov 2022 11:44:46 +0100 From: Jakub Jelinek To: Aldy Hernandez Cc: Richard Biener , Joseph Myers , GCC patches , Andrew MacLeod Subject: Re: [PATCH] [range-ops] Implement sqrt. Message-ID: Reply-To: Jakub Jelinek References: <20221113200553.440728-1-aldyh@redhat.com> <6150f7fd-5a57-c138-f65e-8dc3bf13d11a@codesourcery.com> <4441fc8a-e9e1-6fdd-20d1-473d10122426@codesourcery.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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.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: On Fri, Nov 18, 2022 at 11:37:42AM +0100, Aldy Hernandez wrote: > > Practically strictly > > preserving IEEE exceptions is only important for a very small audience, and > > for that even INEXACT will matter (but we still have -ftrapping-math > > by default). > > For that audience likely all constant / range propagation is futile and thus the > > easiest thing might be to simply cut that off completely? > > > > I'd say what ranger does is reasonable with -ftrapping-math given the current > > practice of handling this option. There's no point in trying to preserve the > > (by accident) "better" handling without ranger. Instead as Joseph says somebody > > would need to sit down, split -ftrapping-math, adjust the default and thorougly > > document things (also with -fnon-call-exceptions which magically makes > > IEEE flag raising operations possibly throw exceptions). As there's currently > > no code motion barriers for FP code with respect to exception flag inspection > > any dead code we preserve is likely going to be unhelpful. > > > > So for now simply amend the documentation as to what -ftrapping-math > > currently means with respect to range/constant propagation? > > So something like "Even in the presence of -ftrapping-math, VRP may fold > operations that may cause exceptions For example, an addition that is > guaranteed to produce a NAN, may be replaced with a NAN, thus eliding the > addition. This may cause any exception that may have been generated by the > addition to not appear in the final program." > > ?? If we just adjust user expectations for -ftrapping-math, shouldn't we introduce another option that will make sure we never optimize away floating point operations which can trap (and probably just disable frange for that mode)? Jakub