On 3/3/25 2:59 AM, Liao Shihua wrote:
The pass ext-dce is only activated at O2 and above. Using O2 instead of O1
in testsuites when using -fdump-ext_dce.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/core_list_init.c: Using -O2 instead of -O1.
        * gcc.target/riscv/pr111384.c: Ditto.
Here's what I'm committing.  Again, thanks for raising this issue!

Jeff


commit 316eaca17ee11f575fc72e139e8cc3f9f5ccb067
Author: Jeff Law <j...@ventanamicro.com>
Date:   Wed Mar 5 22:24:05 2025 -0700

    Improve coverage of ext-dce tests in risc-v testsuite
    
    Inspired by Liao Shihua, this adjusts two tests in the RISC-V testsuite
    to get more coverage.  Drop the -O1 argument and replace it with -fext-dce.
    That way the test gets run across the full set of flags.  We just need to
    make sure to skip -O0.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/riscv/core_list_init.c: Use -fext-dce rather than
            -O1.  Skip for -O0.
            * gcc.target/riscv/pr111384.c: Ditto.

diff --git a/gcc/testsuite/gcc.target/riscv/core_list_init.c 
b/gcc/testsuite/gcc.target/riscv/core_list_init.c
index 2f36dae85aa..eec3a817d80 100644
--- a/gcc/testsuite/gcc.target/riscv/core_list_init.c
+++ b/gcc/testsuite/gcc.target/riscv/core_list_init.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-rtl-ext_dce" } */
+/* { dg-options "-fext-dce -fdump-rtl-ext_dce" } */
 /* { dg-final { scan-rtl-dump {Successfully transformed} "ext_dce" } } */
+/* { dg-skip-if "" { *-*-* } { "-O0"} } */
 
 unsigned short
 core_list_init (int size, short seed) {
diff --git a/gcc/testsuite/gcc.target/riscv/pr111384.c 
b/gcc/testsuite/gcc.target/riscv/pr111384.c
index a4e77d4aeb6..0000bcf33eb 100644
--- a/gcc/testsuite/gcc.target/riscv/pr111384.c
+++ b/gcc/testsuite/gcc.target/riscv/pr111384.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-rtl-ext_dce" } */
+/* { dg-options "-fext-dce -fdump-rtl-ext_dce" } */
 /* { dg-final { scan-rtl-dump {Successfully transformed} "ext_dce" } } */
+/* { dg-skip-if "" { *-*-* } { "-O0"} } */
 
 void
 foo(unsigned int src, unsigned short *dst1, unsigned short *dst2)

Reply via email to