From patchwork Tue Mar 21 15:38:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 72916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1849655wrt; Tue, 21 Mar 2023 08:38:53 -0700 (PDT) X-Google-Smtp-Source: AK7set80BAHZqpiwfnSdcSS4D+0I3qYM06HiXSlE/W3TLzGRgrb+7f9mfQ1yWPUUject/4AQPFQ4 X-Received: by 2002:a17:907:98a9:b0:931:3cbe:3778 with SMTP id ju9-20020a17090798a900b009313cbe3778mr3387936ejc.58.1679413133021; Tue, 21 Mar 2023 08:38:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679413133; cv=none; d=google.com; s=arc-20160816; b=YKZNuQaHvjj3wa1wCG5Dt5hEQmSs5nmVCp0xfSDtWkgVcbbK0BjQ4V+5Q9LtyQ//mT sgwJMZGRYJnePvPtgPyz5d4WfuI/wzzTmYyyA0MaVoSMqhHH1hrfQV/xn/HeLDX1TZQB Fcins2DIGs1+wD8ZmpneR5Axw8FgScN707ghv2KsVnEH5mtLncQHqawEBkusg3Hx8LzA u+oBVpTzPF4h0arI6eoipFqY09Vypvxax4Sdy5PYpSF42Inhp7TigcHWWvbRVW4QbQD6 oF5hiJYt8WnWVuUAN+386C/zdzVHePpMXiieYHt6a7GOT7wmjvRShGCYL85CBxfLCJiF EiZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :content-transfer-encoding:mime-version:subject:cc:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=p7bPpzxw3fxb65U/DAhhKGfHyBhwt1ePHEyi7zqfmqE=; b=flWFnKvLMjsryd3/V4mtp1GjxWUkhzKJ+leZ26UwHpi20JpfXypq+S/uItC4bs/ROw TOCQElJE2i6n5ai4LalWWVJecbbM1G7tOIuktVY89hRB1Qg50pyFA5QS/3Pl6qd4Nln7 52zxiOe3i3h2Fc9UnRg4eRWDPVRQMkqo1EZuRnUuXD+4QFpGVwx20TVhZTJ3mbUcCl6u cYV/HgrivVd0ReMLKjMuXHl3QnKGNMz69HSP2XksqI0jNcGsD4oediW1jsWLEE0+6XYk HQOY9CvSo+gVCSQIfiJ+RFVDEbEbSMVO+ssJTwUyJFIPSz+Kd7pCg2pkcXYG9dZw8WHN jjWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=sJXLtqDl; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n22-20020a170906119600b008d0743df869si12408484eja.704.2023.03.21.08.38.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 08:38:53 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=sJXLtqDl; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 17C843858433 for ; Tue, 21 Mar 2023 15:38:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17C843858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679413132; bh=p7bPpzxw3fxb65U/DAhhKGfHyBhwt1ePHEyi7zqfmqE=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=sJXLtqDle3g+JFohoEfJk/Uy+5HjVD/WbCgQFyurv9y+ftz3haGBZL/W9BJcwnfhx vbKQ6Nuqd04QW0MQ6AejB7IAU+TaH/QMqj1jGz6zPnt8JxZtfeVnjudV4/RDcpPWw6 TvzAD6vmq2yKEXydh/LG84eBv3hDJgRL3zMX8HeA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 To: CC: , Subject: [PATCH] testsuite: Compile-only gcc.dg/tree-ssa/pr100359.c if ! natural_alignment_32 MIME-Version: 1.0 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 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-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760992305664198387?= X-GMAIL-MSGID: =?utf-8?q?1760992305664198387?= (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);