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 EAAA13858424 for ; Fri, 29 Jul 2022 11:40:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EAAA13858424 Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-307-plM2h1bDMoSwCdVeIG5W0g-1; Fri, 29 Jul 2022 07:40:23 -0400 X-MC-Unique: plM2h1bDMoSwCdVeIG5W0g-1 Received: by mail-oo1-f70.google.com with SMTP id x29-20020a4a395d000000b0043573840ab9so1871045oog.17 for ; Fri, 29 Jul 2022 04:40:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=iUmYizOehdi/gDAvTZVUNrfImgxIRmOHzD/XfrDd9tE=; b=a+8HINfaW6PDmXjiQ4dT12Gg/4+DQbBXl2D7GmFGTh9a/kcGgfSKs9rjKDewEXXboc EyzB+AdqQgY6B8FUBE35K0r6526HSX8J0S9CRQxY6jIn0O9c+OOm+LeBlFxXAMLz+OFh 85AWcNxZr96RBqBDntUChBU2gjXJh2Zjt9A2qyictg/E9hsvQInhddQLjyr7G/nWR5QP ld1bKMdt2fHx6a6mcXsrHLjRWn0iKNpOnezCx8XYKo7m30GW9vEQK+T7F9DEo3wYE/0I p66e4f3aNw8q0jNT4gpSevxTNACJSA9Rj2MLbhVluLjcjFRLX7JwG6vphyizxwyEwB7I FhiA== X-Gm-Message-State: AJIora8PJ7QuA1N9OdH2D6Q0stYq38WtwAZPLNnZhXjDyX4bn1JW6t5x ibZlTdoUSL7VN+LbJTzLr8eKE3QNHv+TbYOScNSn0AuqucnbHnuRmDHJxZIyZsP7Qgxqu3coJx5 wniLsQe4xqQ3UzNYbZ5PKRFo= X-Received: by 2002:a05:6870:210b:b0:10b:ed11:4e2d with SMTP id f11-20020a056870210b00b0010bed114e2dmr1504858oae.265.1659094822856; Fri, 29 Jul 2022 04:40:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uZP2paxGB9SxXFvkPCdKOI2E00dWTkxgaTUyoILadd1TMHBg75c37lQwUbsiBVs2cPwGGXRJQo7GRvRaxXGhw= X-Received: by 2002:a05:6870:210b:b0:10b:ed11:4e2d with SMTP id f11-20020a056870210b00b0010bed114e2dmr1504849oae.265.1659094822643; Fri, 29 Jul 2022 04:40:22 -0700 (PDT) MIME-Version: 1.0 From: Aldy Hernandez Date: Fri, 29 Jul 2022 13:40:12 +0200 Message-ID: Subject: spaceship_replacement cannot see through simplified set of FP conditionals To: Jakub Jelinek , GCC Mailing List X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, 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@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2022 11:40:26 -0000 Hi. With my upcoming patch enabling floating point VRP, g++.dg/opt/pr94589-2.C is failing: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598788.html The problem is that phiopt no longer sees the following snippet, because we have folded away the final conditional as true: bool f5 (double i, double j) { signed char __v$_M_value; signed char c$_M_value; bool D.8519; struct partial_ordering __v; struct partial_ordering c; unsigned int _11; bool _16; : if (i_2(D) != j_4(D)) goto ; [INV] else goto ; [INV] : if (i_2(D) >= j_4(D)) goto ; [INV] else goto ; [INV] : if (i_2(D) > j_4(D)) goto ; [INV] else goto ; [INV] : : # c$_M_value_3 = PHI <-1(3), 0(2), 2(5), 1(4)> _11 = (unsigned int) c$_M_value_3; _16 = _11 <= 1; return _16; } This means that spaceship_replacement() now sees one less argument to the PHI: : if (i_2(D) != j_4(D)) goto ; [INV] else goto ; [INV] : if (i_2(D) >= j_4(D)) goto ; [INV] else goto ; [INV] : : # c$_M_value_3 = PHI <-1(3), 0(2), 1(4)> ...and we bail because we are expecting 4 arguments: if (EDGE_COUNT (phi_bb->preds) != 4) return false; Could someone give me a hand here? Can spaceship_replacement easily be adapted to handle this case, or should we be simplifying this elsewhere? Thanks. Aldy