From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id DF4B63858430 for ; Tue, 21 Mar 2023 16:48:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF4B63858430 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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-out2.suse.de (Postfix) with ESMTPS id E52BF20257; Tue, 21 Mar 2023 16:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1679417283; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4+NxssqskNAC9qvzfwuPuR31RDpGmwM+KDw11hAodMg=; b=GADAHWu3bNIwmkiRR0FnakWKfexnCeRNFyVukJR8EmdaVZVnc1Fxorsn2Uy1YOSVDClwdL QmOzffr1sz0vDtGwIR6V1iDcH8G2GF34F+j9rbbnGVkDb8ufDfHfzpM/af4Y7UW24cbAQ5 6txmNNT5/1tbN43sufanQNKg1AbGjXI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1679417283; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4+NxssqskNAC9qvzfwuPuR31RDpGmwM+KDw11hAodMg=; b=3qbcgkm05bJMlqjoH2UyubtuyJwp2hwAtBRa5eoXrJbJuT8DI9WxBvdETet3jhIYhir5zg 283UJyTcDfhPPsBg== 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 D328C13451; Tue, 21 Mar 2023 16:48:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HbCCM8PfGWQnDAAAMHmgww (envelope-from ); Tue, 21 Mar 2023 16:48:03 +0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Richard Biener Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] testsuite: Compile-only gcc.dg/tree-ssa/pr100359.c if ! natural_alignment_32 Date: Tue, 21 Mar 2023 17:47:53 +0100 Message-Id: <02EC10A4-2772-4112-B2B3-5F033229827E@suse.de> References: <20230321153805.9120E2040E@pchp3.se.axis.com> Cc: zhendong.su@inf.ethz.ch In-Reply-To: <20230321153805.9120E2040E@pchp3.se.axis.com> To: Hans-Peter Nilsson via Gcc-patches X-Mailer: iPhone Mail (20D67) X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,SPF_HELO_NONE,SPF_PASS,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 List-Id: > Am 21.03.2023 um 16:38 schrieb Hans-Peter Nilsson via Gcc-patches : >=20 > =EF=BB=BF(CC to respectively author and committer of pr100359.c.) >=20 > Tested cris-elf and native x86_64-linux: the two > scan-tree-dumps pass and x86_64-linux still links. Ok to > commit? Ok Richard=20 > -- >8 -- > The test gcc.dg/tree-ssa/pr100359.c fails the "test for > excess errors" for at least m68k-linux, pru-elf, and > cris-elf according to posts on gcc-testresults. For > cris-elf, the "excess errors" is a failure to link; an > undefined reference to foo, because the code has a call to > an extern function foo, which is not optimized away, and > which is not defined. I guess it's the same for those other > targets. >=20 > =46rom comparative gdb sessions for native x86_64-linux and > cris-elf, I see tree-ssa-sccvn.cc:vn_reference_lookup_3 > (called from the "pre" pass) requires int-size-alignment for > a target to see through the "int *" dereference, that the > expression is constant false and subsequently optimize away > the call to foo. The conclusion is with substantially less > effort available from comments in PR91419. >=20 > The point of the test seems only incidental to > optimizing-out the call to foo, judging from the comments in > PR100359, so an alternative is compile it (not link it) for > all targets. However, I chose to not change the nature of > the test where it passes. >=20 > * gcc.dg/tree-ssa/pr100359.c: Compile-only for ! natural_alignment_32. > --- > gcc/testsuite/gcc.dg/tree-ssa/pr100359.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr100359.c b/gcc/testsuite/gcc.= dg/tree-ssa/pr100359.c > index 29243522caaf..236dbef41c4e 100644 > --- a/gcc/testsuite/gcc.dg/tree-ssa/pr100359.c > +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr100359.c > @@ -1,4 +1,5 @@ > -/* { dg-do link } */ > +/* { dg-do link { target natural_alignment_32 } } */ > +/* { dg-do compile { target { ! natural_alignment_32 } } } */ > /* { dg-options "-O3 -fdump-tree-cunrolli-optimized" } */ >=20 > extern void foo(void); > --=20 > 2.30.2 >=20