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 48D1A3858C20 for ; Mon, 31 Jan 2022 10:12:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 48D1A3858C20 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-193-UjO1rTnyPQeEabb2Izg2UA-1; Mon, 31 Jan 2022 05:12:55 -0500 X-MC-Unique: UjO1rTnyPQeEabb2Izg2UA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3593F1083F6D; Mon, 31 Jan 2022 10:12:54 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.125]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C30FF752B2; Mon, 31 Jan 2022 10:12:53 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 20VACoOS3417543 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 31 Jan 2022 11:12:51 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 20VACnRW3417542; Mon, 31 Jan 2022 11:12:49 +0100 Date: Mon, 31 Jan 2022 11:12:49 +0100 From: Jakub Jelinek To: Navid Rahimi , Andrew Pinski Cc: Richard Biener , Jeff Law , "gcc-patches@gcc.gnu.org" Subject: Re: [EXTERNAL] [PATCH] testsuite: Fix up tree-ssa/pr103514.c testcase [PR103514] Message-ID: <20220131101249.GI2646553@tucnak> Reply-To: Jakub Jelinek References: <20220129164609.GX2646553@tucnak> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2022 10:13:02 -0000 On Sun, Jan 30, 2022 at 10:16:44AM +0000, Navid Rahimi via Gcc-patches wrote: > Thanks Jakob for the correction. Sadly, I didn’t have any access to any non x86 architecture. But x86 was fully tested and there was no regression. > > In my spare time I will look at implementation of this for short-circuit targets. Note, it isn't just about those targets. If you write the code as: _Bool g (_Bool a, _Bool b) { _Bool c; if (!a) c = 0; else if (!b) c = 0; else c = 1; return c == (a ^ b); } instead, it will not match either, not even on x86, even when it is equivalent. Though, maybe for non-short-circuiting targets we should recognize this somewhere and turn into c = a & b; Since phiopt2 it is: [local count: 1073741824]: if (a_4(D) != 0) goto ; [50.00%] else goto ; [50.00%] [local count: 536870913]: _8 = (int) b_5(D); [local count: 1073741824]: # iftmp.0_3 = PHI <_8(3), 0(2)> and phiopt3 makes [local count: 1073741824]: if (a_4(D) != 0) goto ; [50.00%] else goto ; [50.00%] [local count: 536870913]: [local count: 1073741824]: # _9 = PHI iftmp.0_3 = (int) _9; out of that. CCing Andrew if he'd like to have a look for GCC 13. Jakub