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 38F123858D37 for ; Wed, 2 Mar 2022 09:42:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 38F123858D37 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-467-jIDGJlJlNqKzqgNBv-R7Xw-1; Wed, 02 Mar 2022 04:42:34 -0500 X-MC-Unique: jIDGJlJlNqKzqgNBv-R7Xw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C499B824FA6 for ; Wed, 2 Mar 2022 09:42:33 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F90B710AC for ; Wed, 2 Mar 2022 09:42:32 +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 2229gTHT964336 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 2 Mar 2022 10:42:29 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 2229gSn1964335 for gcc-patches@gcc.gnu.org; Wed, 2 Mar 2022 10:42:28 +0100 Date: Wed, 2 Mar 2022 10:42:28 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Add testcases for already fixed PR [PR100541] Message-ID: Reply-To: Jakub Jelinek MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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=-5.3 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_H5, RCVD_IN_MSPIKE_WL, 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: Wed, 02 Mar 2022 09:42:37 -0000 Hi! These testcases started failing with r12-630 and one of them got fixed with r12-4531 (aka PR102764 fix and r12-4616 further improved the fix) and the other went latent in r12-2591 (i.e. threader changes) and I believe was fixed for real by the PR102764 fix too. Regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2022-03-02 Jakub Jelinek PR debug/100541 * g++.dg/opt/pr100541-1.C: New test. * g++.dg/opt/pr100541-2.C: New test. --- gcc/testsuite/g++.dg/opt/pr100541-1.C.jj 2022-03-01 16:52:21.115876189 +0100 +++ gcc/testsuite/g++.dg/opt/pr100541-1.C 2022-03-01 16:51:35.760341725 +0100 @@ -0,0 +1,24 @@ +// PR debug/100541 +// { dg-do compile } +// { dg-options "-O3 -fno-expensive-optimizations -fno-tree-dce -fno-tree-dominator-opts -fcompare-debug" } + +int a, b, i, x, y; + +int +foo () +{ + int rcmd = 0; + switch (x) { + case 0: + if (i) + rcmd = 6; + if (y % 3) + int &m1 = rcmd = rcmd | 5; + break; + case 1: + rcmd = b; + } + if (rcmd != 7) + return rcmd; + return a; +} --- gcc/testsuite/g++.dg/opt/pr100541-2.C.jj 2022-03-01 16:52:25.162819696 +0100 +++ gcc/testsuite/g++.dg/opt/pr100541-2.C 2022-03-01 16:53:05.497256709 +0100 @@ -0,0 +1,25 @@ +// PR debug/100541 +// { dg-do compile { target c++11 } } +// { dg-options "-O2 -fno-tree-dce -fno-tree-dominator-opts -fcompare-debug" } + +int INVALID_TILE; +void GetSlopePixelZ(); +long RUNWAY_IN_block; +struct Airport { + long flags; +}; +struct Station { + Airport airport; +} * HandleCrashedAircraft_st; +short HandleCrashedAircraft_v_0; +void HandleCrashedAircraft() { + Station *__trans_tmp_1 = INVALID_TILE ? nullptr : HandleCrashedAircraft_st, + *st; + if (HandleCrashedAircraft_v_0 && __trans_tmp_1 == nullptr && + HandleCrashedAircraft_v_0 % 3) + GetSlopePixelZ(); + if (HandleCrashedAircraft_v_0) + GetSlopePixelZ(); + if (__trans_tmp_1) + st->airport.flags &= RUNWAY_IN_block; +} Jakub