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.133.124]) by sourceware.org (Postfix) with ESMTPS id EE56338515C9 for ; Fri, 24 Mar 2023 15:20:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE56338515C9 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=1679671212; 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: content-transfer-encoding:content-transfer-encoding:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=WLHQ689Mocf4rNZFjtjIdDSkAARvfmSLXIyU2l8sBTw=; b=YZMgqcYWkcKf8FnE6vrCBaNvsM+4R5vq13sW2QZQgWLQUnkXpuQmu/wNrzO3HXcOG2ny2K 1L9YWV0cVBdGiSuhTJiCi3ptbTT4MNl80csTxx5CHTP0hs/FhD0fEOy0o1wA07POO9EVXD yPF2rI0lcO9OMcxwWn81LPhgQ9edpho= 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-547-reoO_PUGNCGm52-E26TiOA-1; Fri, 24 Mar 2023 11:19:07 -0400 X-MC-Unique: reoO_PUGNCGm52-E26TiOA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A593629AA3B6 for ; Fri, 24 Mar 2023 15:19:01 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 46B1340C6E68 for ; Fri, 24 Mar 2023 15:19:00 +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 32OFItw83799397 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 24 Mar 2023 16:18:58 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 32OFIoJW3796005 for gcc-patches@gcc.gnu.org; Fri, 24 Mar 2023 16:18:50 +0100 Resent-From: Jakub Jelinek Resent-Date: Fri, 24 Mar 2023 16:18:50 +0100 Resent-Message-ID: Resent-To: gcc-patches@gcc.gnu.org Date: Fri, 24 Mar 2023 16:15:39 +0100 From: Jakub Jelinek To: Andrew MacLeod Cc: gcc-patches , Richard Biener Subject: Re: [PATCH] PR tree-optimization/109274 - Don't interpret contents of a value_relation record. Message-ID: Reply-To: Jakub Jelinek References: <2e0b9177-f8ce-d55a-d6bb-71eb89a9700d@redhat.com> MIME-Version: 1.0 In-Reply-To: <2e0b9177-f8ce-d55a-d6bb-71eb89a9700d@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 List-Id: On Fri, Mar 24, 2023 at 11:08:54AM -0400, Andrew MacLeod wrote: > Before floating point relations were added, we tried to sanitize > value-relation records to not include non-sensensical records... ie x != x > or x < x.   Instead, we made a VREL_VARYING record with no operands. > > When floating point relation support was added, some of these were no longer > non-sensical, AND we expanded the use of value_relation records into GORI > shortly thereafter. > > As a result, this sanitization is no longer needed, nor desired. The Oracle > does not create records with op1 == op2 already, so its only within GORI > that these records can exist, and we shouldn't try to interpret them. > > The bug occurs because the "sanitized" records doesn't set op1 and op2, and > changes the relation to VARYING..  and we expected the operands it to be set > the way they were specified.  We should not be setting a VREL_VARYING record > if asked to set something else.  In fact, we are missing some opportunities > because we are trying to FP range-ops that op1 != op1  but its getting > transformed into a VREL_VARYING record and not communicated properly. > > Currently bootstrapping on x86_64-pc-linux-gnu and assuming no regressions, > OK for trunk? > > Andrew > commit 1f02961b23976d35b10e2399708c6eb00632f9d6 > Author: Andrew MacLeod > Date: Fri Mar 24 09:18:33 2023 -0400 > > Don't interpret contents of a value_relation record. > > before floating point relations were added, we tried to sanitize > value-relation records to not include non-sensensical records... ie > x != x or x < x. INstead, we made a VREL_VARYING record with no s/IN/In/ > operands. > > When floating point relations were supported, some of these were no > longer non-sensical, AND we expanded the use of value_relation records > into GORI. > > As a result, this sanitization is no longer needed. The Oracle > does not create records with op1 == op2, so its only within GORI > that these records can exist, and we shouldnt try to interpret them. s/shouldnt/shouldn't/ > > The bug occurs because the "sanitized" records doesnt set op1 anmd op2, s/doesnt/doesn't/ > but we have a record so expected it to be set. > > PR tree-optimization/109265 > PR tree-optimization/109274 > gcc/ > * value-relation.h (value_relation::set_relation): Always create the > record that is requested. > > gcc/testsuite/ > * gcc.dg/pr109274.c: New. LGTM, indeed with floating point a != a isn't nonsensical but basically __builtin_isnan (a) check. I'll commit the Fortran testcase I've added in my version of the patch incrementally when you commit. Jakub