* [PATCH] rtl-optimization/110869 Fix tests cmp-mem-const-*.c for sparc
@ 2023-08-07 13:32 Stefan Schulze Frielinghaus
2023-08-07 17:14 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Schulze Frielinghaus @ 2023-08-07 13:32 UTC (permalink / raw)
To: gcc-patches; +Cc: Stefan Schulze Frielinghaus
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.
Ok for mainline?
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.
---
gcc/testsuite/gcc.dg/cmp-mem-const-1.c | 2 +-
gcc/testsuite/gcc.dg/cmp-mem-const-2.c | 2 +-
gcc/testsuite/gcc.dg/cmp-mem-const-3.c | 6 ++++--
gcc/testsuite/gcc.dg/cmp-mem-const-4.c | 6 ++++--
gcc/testsuite/gcc.dg/cmp-mem-const-5.c | 6 ++++--
gcc/testsuite/gcc.dg/cmp-mem-const-6.c | 6 ++++--
6 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-1.c b/gcc/testsuite/gcc.dg/cmp-mem-const-1.c
index 4f21a1ade4a..0b0e7331354 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 7b722951594..8022137a8ec 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 ed5059d3807..c60ecdb4026 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 23e83372bee..7aa403d76d9 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 d266896a25e..4316dcb5605 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 68d7a9d0265..d9046af79eb 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;
--
2.41.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rtl-optimization/110869 Fix tests cmp-mem-const-*.c for sparc
2023-08-07 13:32 [PATCH] rtl-optimization/110869 Fix tests cmp-mem-const-*.c for sparc Stefan Schulze Frielinghaus
@ 2023-08-07 17:14 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2023-08-07 17:14 UTC (permalink / raw)
To: Stefan Schulze Frielinghaus, gcc-patches
On 8/7/23 07:32, Stefan Schulze Frielinghaus via Gcc-patches wrote:
> 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.
>
> Ok for mainline?
>
> 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.
OK. Though I suspect the lack of memory comparison to a constant likely
shows up elsewhere. We're likely going to end up with a significant
number of excludes for -3 and -4.
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-07 17:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-07 13:32 [PATCH] rtl-optimization/110869 Fix tests cmp-mem-const-*.c for sparc Stefan Schulze Frielinghaus
2023-08-07 17:14 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).