From: Stefan Schulze Frielinghaus Date: Tue, 8 Aug 2023 06:53:12 +0000 (+0200) Subject: rtl-optimization/110869 Fix tests cmp-mem-const-*.c for sparc X-Git-Tag: basepoints/gcc-15~7065 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3a8dde08b420dbe9cacbc1a1febaaf77357f4d4;p=thirdparty%2Fgcc.git rtl-optimization/110869 Fix tests cmp-mem-const-*.c for sparc This fixes the rather new tests cmp-mem-const-{1,2,3,4,5,6}.c for sparc. For -1 and -2 we need at least optimization level 2 on sparc. For the sake of homogeneity, change all test cases to -O2. For -3 and -4 we do not end up with a comparison of memory and a constant, and finally for -5 and -6 the constants are reduced by a prior optimization which means there is nothing left to do. Thus excluding sparc from those tests. gcc/testsuite/ChangeLog: PR rtl-optimization/110869 * gcc.dg/cmp-mem-const-1.c: Use optimization level 2. * gcc.dg/cmp-mem-const-2.c: Dito. * gcc.dg/cmp-mem-const-3.c: Exclude sparc from this test. * gcc.dg/cmp-mem-const-4.c: Dito. * gcc.dg/cmp-mem-const-5.c: Dito. * gcc.dg/cmp-mem-const-6.c: Dito. --- diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-1.c b/gcc/testsuite/gcc.dg/cmp-mem-const-1.c index 4f21a1ade4a3..0b0e7331354a 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-1.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { lp64 } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to QI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-2.c b/gcc/testsuite/gcc.dg/cmp-mem-const-2.c index 7b722951594c..8022137a8eca 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-2.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-2.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { lp64 } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to QI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-3.c b/gcc/testsuite/gcc.dg/cmp-mem-const-3.c index ed5059d38074..c60ecdb4026c 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-3.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-3.c @@ -1,5 +1,7 @@ -/* { dg-do compile { target { lp64 } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */ +/* Excluding sparc since there we do not end up with a comparison of memory and + a constant which means that the optimization is not applicable. */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to HI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-4.c b/gcc/testsuite/gcc.dg/cmp-mem-const-4.c index 23e83372beed..7aa403d76d97 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-4.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-4.c @@ -1,5 +1,7 @@ -/* { dg-do compile { target { lp64 } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */ +/* Excluding sparc since there we do not end up with a comparison of memory and + a constant which means that the optimization is not applicable. */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to HI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-5.c b/gcc/testsuite/gcc.dg/cmp-mem-const-5.c index d266896a25e0..4316dcb56050 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-5.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-5.c @@ -1,5 +1,7 @@ -/* { dg-do compile { target { lp64 } && ! target { sparc*-*-* } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */ +/* Excluding sparc since there a prior optimization already reduced the + constant, i.e., nothing left for us. */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to SI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-6.c b/gcc/testsuite/gcc.dg/cmp-mem-const-6.c index 68d7a9d02658..d9046af79eb6 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-6.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-6.c @@ -1,5 +1,7 @@ -/* { dg-do compile { target { lp64 } && ! target { sparc*-*-* } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */ +/* Excluding sparc since there a prior optimization already reduced the + constant, i.e., nothing left for us. */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to SI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t;