From patchwork Tue Dec 3 07:23:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bohan Lei X-Patchwork-Id: 102282 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3EC8C3858CD9 for ; Tue, 3 Dec 2024 07:25:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3EC8C3858CD9 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=nmnyUehb X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by sourceware.org (Postfix) with ESMTPS id 8532E3858D3C for ; Tue, 3 Dec 2024 07:24:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8532E3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.alibaba.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8532E3858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=115.124.30.133 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733210653; cv=none; b=EzO978ggj14e6SkO8oX2hOjug7cmduGwHAZ/S8WV3FKSrPrz515kF4spR2xLsgnAfsjw8F4MJo/QC+95wd3Au6PicHQLhTL7m3udokh0D2SygfzJFnTVIUkZ/K8k2fM5eFuHnRPhskgI2F0raNl/h0NL2O1+tMuKHUsurGSVahY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733210653; c=relaxed/simple; bh=lnkkCOwIoVARK5GTbjF8tAxWGxT/zsWtDiQ7p72yMVo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=YmPUbe1gKKI/95ZjOHxWcCli6NNL1aYWfjyvAh0F2GtLGLMGa1SIyXT4Bk6pF15rHZhbTUTAlkHssF0gkwWXv0Zx9K0T96jSlEWwg6ax5sQAkqoQOoic3ga4c50icci7GFrrvDkfHT94mDfry7pPOBhibzRKi+CteN1cMBmZ3uY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8532E3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1733210650; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=IbR4dOQ2wZjBWSLeie5qK2uy87xYSRBFBrJsmwXktds=; b=nmnyUehb8fR8qnqPVto6jie/TgI8BRHHu0hq/w5vn7c0K3fdvfuSCMtw7PwN4TO6SBhntURrHTWCgIhfqfs+zBZOMl8ccLOl12jnmwBde4ZwRRQ1KLDRmngVqObknsbEIy9n4GJSgwXkVHNvYQQMRz94BcUgrublozOyiQViUJM= Received: from localhost(mailfrom:garthlei@linux.alibaba.com fp:SMTPD_---0WKlqoFX_1733210637 cluster:ay36) by smtp.aliyun-inc.com; Tue, 03 Dec 2024 15:24:07 +0800 From: Bohan Lei To: gcc-patches@gcc.gnu.org Cc: jeffreyalaw@gmail.com, mariamarutunian@gmail.com, Bohan Lei Subject: [PATCH] testsuite: Fix CRC testcases Date: Tue, 3 Dec 2024 15:23:54 +0800 Message-Id: <20241203072354.46945-1-garthlei@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) MIME-Version: 1.0 X-Spam-Status: No, score=-28.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Hi all, The latest CRC optimization patches include some testcases that do not work well. Some testcases in gcc/testsuite/gcc.dg lead to UNRESOLVED results when testing without an explicit -O flag. Other testcases in gcc/testsuite/gcc.target/riscv do not work when testing with RV32 -march/-mabi options on riscv64* compilers, and in the opposite case. This patch tries to deal with the aforementioned issues. Thanks, Bohan --- gcc/testsuite/gcc.dg/crc-linux-1.c | 2 +- gcc/testsuite/gcc.dg/crc-linux-2.c | 2 +- gcc/testsuite/gcc.dg/crc-linux-4.c | 2 +- gcc/testsuite/gcc.dg/crc-linux-5.c | 2 +- gcc/testsuite/gcc.dg/crc-not-crc-15.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-1.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-10.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-11.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-12.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-13.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-14.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-15.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-16.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-17.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-2.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-3.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-4.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-5.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-6.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-7.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-8.c | 2 +- gcc/testsuite/gcc.dg/crc-side-instr-9.c | 2 +- gcc/testsuite/gcc.target/riscv/crc-builtin-zbc32.c | 4 ++-- gcc/testsuite/gcc.target/riscv/crc-builtin-zbc64.c | 4 ++-- 24 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gcc/testsuite/gcc.dg/crc-linux-1.c b/gcc/testsuite/gcc.dg/crc-linux-1.c index 918b423a583..3261ba48b8b 100644 --- a/gcc/testsuite/gcc.dg/crc-linux-1.c +++ b/gcc/testsuite/gcc.dg/crc-linux-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details -w" } */ +/* { dg-options "-O2 -fdump-tree-crc-details -w" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-O3" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-linux-2.c b/gcc/testsuite/gcc.dg/crc-linux-2.c index 990a28cef6f..156d9986aaf 100644 --- a/gcc/testsuite/gcc.dg/crc-linux-2.c +++ b/gcc/testsuite/gcc.dg/crc-linux-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-linux-4.c b/gcc/testsuite/gcc.dg/crc-linux-4.c index 50cbbba49d2..81f35ae2bc5 100644 --- a/gcc/testsuite/gcc.dg/crc-linux-4.c +++ b/gcc/testsuite/gcc.dg/crc-linux-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details -w" } */ +/* { dg-options "-O2 -fdump-tree-crc-details -w" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ /* We don't detect, it's optimized to branch-less CRC. */ diff --git a/gcc/testsuite/gcc.dg/crc-linux-5.c b/gcc/testsuite/gcc.dg/crc-linux-5.c index ff3cc25fb66..873257daa8c 100644 --- a/gcc/testsuite/gcc.dg/crc-linux-5.c +++ b/gcc/testsuite/gcc.dg/crc-linux-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-not-crc-15.c b/gcc/testsuite/gcc.dg/crc-not-crc-15.c index cf7993a2c49..05b46ae68da 100644 --- a/gcc/testsuite/gcc.dg/crc-not-crc-15.c +++ b/gcc/testsuite/gcc.dg/crc-not-crc-15.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc" } */ +/* { dg-options "-O2 -fdump-tree-crc" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-O3" "-flto" } } */ /* With -O3 the cycles is split into 2, diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-1.c b/gcc/testsuite/gcc.dg/crc-side-instr-1.c index 69738d5c866..d9977d9865f 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-1.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-10.c b/gcc/testsuite/gcc.dg/crc-side-instr-10.c index 765572cf9b7..3c807aec9db 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-10.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-10.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ typedef unsigned short ee_u16; diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-11.c b/gcc/testsuite/gcc.dg/crc-side-instr-11.c index d8a7a88de5d..8c73c0186b0 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-11.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-11.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ typedef unsigned short ee_u16; diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-12.c b/gcc/testsuite/gcc.dg/crc-side-instr-12.c index 4511c08dc6b..7098ed074ac 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-12.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-12.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ typedef unsigned short ee_u16; diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-13.c b/gcc/testsuite/gcc.dg/crc-side-instr-13.c index 968a35bf4df..7a0fea11eb3 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-13.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-13.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ typedef unsigned short ee_u16; diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-14.c b/gcc/testsuite/gcc.dg/crc-side-instr-14.c index c8b671f571e..da2d0434253 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-14.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-14.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-15.c b/gcc/testsuite/gcc.dg/crc-side-instr-15.c index ec3c879034d..78ef1e91ee7 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-15.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-15.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ typedef unsigned short ee_u16; diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-16.c b/gcc/testsuite/gcc.dg/crc-side-instr-16.c index 2f14c90ab11..665d0571f23 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-16.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-16.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ typedef unsigned short ee_u16; diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-17.c b/gcc/testsuite/gcc.dg/crc-side-instr-17.c index 8f98df87446..cf67042a4f9 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-17.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-17.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ typedef unsigned short ee_u16; diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-2.c b/gcc/testsuite/gcc.dg/crc-side-instr-2.c index 23dfa3edc17..146b12c27c0 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-2.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-3.c b/gcc/testsuite/gcc.dg/crc-side-instr-3.c index 731c6624a2e..67ecef66692 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-3.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-4.c b/gcc/testsuite/gcc.dg/crc-side-instr-4.c index 7612c52c67e..294157719ca 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-4.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-5.c b/gcc/testsuite/gcc.dg/crc-side-instr-5.c index ef97028e881..75ccf3d984d 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-5.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-6.c b/gcc/testsuite/gcc.dg/crc-side-instr-6.c index f559fa94a53..e0006793efe 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-6.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-6.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-7.c b/gcc/testsuite/gcc.dg/crc-side-instr-7.c index d80aadc6ccb..5887ae18e27 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-7.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-8.c b/gcc/testsuite/gcc.dg/crc-side-instr-8.c index 23263e156a1..562eb608e40 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-8.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ #include diff --git a/gcc/testsuite/gcc.dg/crc-side-instr-9.c b/gcc/testsuite/gcc.dg/crc-side-instr-9.c index 477318e05e0..7b2fc6a9b3d 100644 --- a/gcc/testsuite/gcc.dg/crc-side-instr-9.c +++ b/gcc/testsuite/gcc.dg/crc-side-instr-9.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-crc-details" } */ +/* { dg-options "-O2 -fdump-tree-crc-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */ typedef unsigned short ee_u16; diff --git a/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc32.c b/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc32.c index 20d7d25f60e..a6703c4684b 100644 --- a/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc32.c +++ b/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc32.c @@ -1,5 +1,5 @@ -/* { dg-do compile { target { riscv32*-*-* } } } */ -/* { dg-options "-march=rv32gc_zbc" } */ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gc_zbc -mabi=ilp32d" } */ #include diff --git a/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc64.c b/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc64.c index d99a78daaa9..97bbe052ec1 100644 --- a/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc64.c +++ b/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc64.c @@ -1,5 +1,5 @@ -/* { dg-do compile { target { riscv64*-*-* } } } */ -/* { dg-options "-march=rv64gc_zbc" } */ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gc_zbc -mabi=lp64d" } */ #include