From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 2F0463858C2C for ; Tue, 28 Sep 2021 10:50:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F0463858C2C Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0CC392225D for ; Tue, 28 Sep 2021 10:50:21 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EEA0013A4A for ; Tue, 28 Sep 2021 10:50:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gXMhOWzzUmFnTgAAMHmgww (envelope-from ) for ; Tue, 28 Sep 2021 10:50:20 +0000 Date: Tue, 28 Sep 2021 12:50:20 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/99793 - testcase for the PR Message-ID: <9r7p216-6np0-o249-9pp2-p83p87734o11@fhfr.qr> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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: Tue, 28 Sep 2021 10:50:24 -0000 This adds a testcase for the PR which was fixed with the fix for PR100112. Tested on x86_64-unknown-linux-gnu, pushed. 2021-09-28 Richard Biener PR tree-optimization/99793 * gcc.dg/tree-ssa/pr99793.c: New testcase. --- gcc/testsuite/gcc.dg/tree-ssa/pr99793.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr99793.c diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr99793.c b/gcc/testsuite/gcc.dg/tree-ssa/pr99793.c new file mode 100644 index 00000000000..912744928e5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr99793.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fstrict-aliasing -fdump-tree-optimized" } */ + +extern void foo(void); +static int a, *b = &a, c, *d = &c; +int main() +{ + int **e = &d; + if (!((unsigned)((*e = d) == 0) - (*b = 1))) + foo(); + return 0; +} + +/* { dg-final { scan-tree-dump-not "foo" "optimized" } } */ -- 2.31.1