From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 5AA3B3858C52 for ; Tue, 21 Mar 2023 15:38:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5AA3B3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1679413089; x=1710949089; h=from:to:cc:subject:mime-version: content-transfer-encoding:message-id:date; bh=p7bPpzxw3fxb65U/DAhhKGfHyBhwt1ePHEyi7zqfmqE=; b=AtPDazDHY8aAKPASO4MsG95YyOtUVnmX0eirZ2od3mg8Wsk0EuJCZz2a oY/DVR/KgM81LLcHnj0Hv0B4QvLmzMANUDCIs/QMswn1HRVFguwHiC14n 7g5RoHFyihBXyEv0ReWhxuS+BTZ86pOQqbrxYgQIjrzW1Uy4gS3EYhqXY 3Z09sXiLgGgnqaqZX2uyGaRaAxGiA92mlujydl7jBM7xJ9SGgXe+DSOkX glTk32bxi642SgD5V7QHLyPbN8+ZXJjKYlEzd7KMMbwQRFO9wED5z/0Yr 3q+jbLLXSQfwABjunDFMqWp0njwvOsLxsy96IIMXuIZTv5lNuwowoMckP g==; From: Hans-Peter Nilsson To: CC: , Subject: [PATCH] testsuite: Compile-only gcc.dg/tree-ssa/pr100359.c if ! natural_alignment_32 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-ID: <20230321153805.9120E2040E@pchp3.se.axis.com> Date: Tue, 21 Mar 2023 16:38:05 +0100 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,SPF_HELO_PASS,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: (CC to respectively author and committer of pr100359.c.) Tested cris-elf and native x86_64-linux: the two scan-tree-dumps pass and x86_64-linux still links. Ok to commit? -- >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. >From 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. 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. * 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(-) 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" } */ extern void foo(void); -- 2.30.2