From: Hans-Peter Nilsson <hp@axis.com>
To: <gcc-patches@gcc.gnu.org>
Subject: [COMMITTED] Revert "Revert "testsuite/gcc.target/cris/pr93372-2.c: Handle xpass from combine improvement"" combine improvement
Date: Wed, 8 May 2024 04:26:01 +0200 [thread overview]
Message-ID: <20240508022601.E338220432@pchp3.se.axis.com> (raw)
In-Reply-To: <20240410231632.26E9820442@pchp3.se.axis.com> (message from Hans-Peter Nilsson on Thu, 11 Apr 2024 01:16:32 +0200)
> From: Hans-Peter Nilsson <hp@axis.com>
> Date: Thu, 11 Apr 2024 01:16:32 +0200
I committed this revert of a revert, as r15-311, as the
prerequisite was also revert-reverted, in r15-268.
-- >8 --
This reverts commit 39f81924d88e3cc197fc3df74204c9b5e01e12f7.
---
gcc/testsuite/gcc.target/cris/pr93372-2.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/gcc/testsuite/gcc.target/cris/pr93372-2.c b/gcc/testsuite/gcc.target/cris/pr93372-2.c
index 912069c018d5..2ef6471a990b 100644
--- a/gcc/testsuite/gcc.target/cris/pr93372-2.c
+++ b/gcc/testsuite/gcc.target/cris/pr93372-2.c
@@ -1,19 +1,20 @@
/* Check that eliminable compare-instructions are eliminated. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-final { scan-assembler-not "\tcmp|\ttest" { xfail *-*-* } } } */
-/* { dg-final { scan-assembler-not "\tnot" { xfail cc0 } } } */
-/* { dg-final { scan-assembler-not "\tlsr" { xfail cc0 } } } */
+/* { dg-final { scan-assembler-not "\tcmp|\ttest" } } */
+/* { dg-final { scan-assembler-not "\tnot" } } */
+/* { dg-final { scan-assembler-not "\tlsr" } } */
+/* We should get just one move, storing the result into *d. */
+/* { dg-final { scan-assembler-times "\tmove" 1 } } */
int f(int a, int b, int *d)
{
int c = a - b;
- /* Whoops! We get a cmp.d with the original operands here. */
+ /* We used to get a cmp.d with the original operands here. */
*d = (c == 0);
- /* Whoops! While we don't get a test.d for the result here for cc0,
- we get a sequence of insns: a move, a "not" and a shift of the
- subtraction-result, where a simple "spl" would have done. */
+ /* We used to get a suboptimal sequence, but now we get the optimal "sge"
+ (a.k.a "spl") re-using flags from the subtraction. */
return c >= 0;
}
--
2.30.2
brgds, H-P
prev parent reply other threads:[~2024-05-08 2:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 2:06 [COMMITTED] testsuite/gcc.target/cris/pr93372-2.c: Handle xpass from " Hans-Peter Nilsson
2024-04-09 20:18 ` Segher Boessenkool
2024-04-10 23:16 ` [REVERTED] " Hans-Peter Nilsson
2024-05-08 2:26 ` Hans-Peter Nilsson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240508022601.E338220432@pchp3.se.axis.com \
--to=hp@axis.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).