public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] x86: Add a testcase for PR target/31799
@ 2020-11-17 14:04 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2020-11-17 14:04 UTC (permalink / raw)
  To: gcc-patches

Add a testcase for PR target/31799 which was fixed by

commit 4f0473fe89e68bf7c09542ee5c3684da25a5b435
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Fri May 12 21:04:05 2017 +0200

    compare-elim.c (try_eliminate_compare): Canonicalize operation with embedded compare to [(set (reg:CCM) (compare:CCM...

            * compare-elim.c (try_eliminate_compare): Canonicalize
            operation with embedded compare to
            [(set (reg:CCM) (compare:CCM (operation) (immediate)))
             (set (reg) (operation)].

            * config/i386/i386.c (TARGET_FLAGS_REGNUM): New define.

in GCC 8.

	PR target/31799
	* gcc.target/i386/pr31799.c: New test.
---
 gcc/testsuite/gcc.target/i386/pr31799.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr31799.c

diff --git a/gcc/testsuite/gcc.target/i386/pr31799.c b/gcc/testsuite/gcc.target/i386/pr31799.c
new file mode 100644
index 00000000000..c72c4eab986
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr31799.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+foo (int x, int *y, int *z)
+{
+  *z = ++x;
+  if (x != 0)
+  *y = 1;
+}
+
+/* { dg-final { scan-assembler-not "test" } } */
-- 
2.28.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-17 14:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 14:04 [PATCH] x86: Add a testcase for PR target/31799 H.J. Lu

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).