From patchwork Fri Sep 8 21:04:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1831730 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=IOqDAq3g; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rj7sQ2F2xz1yhG for ; Sat, 9 Sep 2023 07:04:41 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 04D613858C27 for ; Fri, 8 Sep 2023 21:04:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04D613858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694207079; bh=q+dxi9f7Umfdsri3XBu6bqstMVTAiOhdEY9LVhXFAiA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=IOqDAq3gPREGdly+vj8l6a6mL4W7kP3YL2D34O5Mk9VTRu5L5C138fSbL9lVQMgK7 NSxski63AVBsQD3bKpKsY3QrWDXZQm8ErPBLIoADslmpuxx7T2Y+E9KFLEglPKI2TP IEYlrUhf8LsZZDZQfgeWExgE5OYK2MNcd5vMSJmk= 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 631F33858D1E for ; Fri, 8 Sep 2023 21:04:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 631F33858D1E Received: from mimecast-mx02.redhat.com (mx-ext.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-602-2wm7AxoOMZGtQVuzPp9tHQ-1; Fri, 08 Sep 2023 17:04:16 -0400 X-MC-Unique: 2wm7AxoOMZGtQVuzPp9tHQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52C6F281CC2C for ; Fri, 8 Sep 2023 21:04:16 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.22.33.78]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 33527C03295; Fri, 8 Sep 2023 21:04:16 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 388L4FFu817138 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 8 Sep 2023 17:04:15 -0400 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 388L4FlK817137; Fri, 8 Sep 2023 17:04:15 -0400 To: GCC patches Subject: [COMMITTED] [frange] Revert relation handling in LTGT_EXPR. Date: Fri, 8 Sep 2023 17:04:07 -0400 Message-ID: <20230908210412.817122-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" In trying to come up with a missing testcase for commit 979e0fbf53cd, I've realized the patch doesn't catch anything. A relation of VREL_EQ in foperator_ltgt::fold_range() is either both arguments the same (x LTGT_EXPR x), which we should never emit, or two arguments that are actually the same, in which case !NAN applies, and the whole thing can be handled as NE_EXPR further down. The whole FP relation thing is getting a face lift shortly, thanks to comments from both Jakub and Andrew, but there's no need in keeping useless code around. gcc/ChangeLog: * range-op-float.cc (foperator_ltgt::fold_range): Do not special case VREL_EQ nor call frelop_early_resolve. --- gcc/range-op-float.cc | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 89c401e040a..cc729e12a9e 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -2206,21 +2206,6 @@ public: const frange &op1, const frange &op2, relation_trio trio = TRIO_VARYING) const final override { - relation_kind rel = trio.op1_op2 (); - - // VREL_EQ is really VREL_(UN)EQ because we could have a NAN in - // the operands, but since LTGT_EXPR is really a NE_EXPR without - // the NAN, VREL_EQ & LTGT_EXPR is an impossibility. - if (rel == VREL_EQ) - { - r = range_false (type); - return true; - } - // ...otherwise pretend we're trying to resolve a NE_EXPR and - // everything will "just work". - if (frelop_early_resolve (r, type, op1, op2, trio, VREL_NE)) - return true; - if (op1.known_isnan () || op2.known_isnan ()) { r = range_false (type);