public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add a testcase for PR tree-optimization/102892
@ 2021-11-10 19:26 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2021-11-10 19:26 UTC (permalink / raw)
  To: gcc-patches

PR tree-optimization/102892 is fixed by

commit 4b3a325f07acebf47e82de227ce1d5ba62f5bcae
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Thu Oct 28 15:35:21 2021 +0200

    Remove VRP threader passes in exchange for better threading pre-VRP.

	* gcc.dg/pr102892-1.c: New file.
	* gcc.dg/pr102892-2.c: Likewise.
---
 gcc/testsuite/gcc.dg/pr102892-1.c | 21 +++++++++++++++++++++
 gcc/testsuite/gcc.dg/pr102892-2.c |  7 +++++++
 2 files changed, 28 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/pr102892-1.c
 create mode 100644 gcc/testsuite/gcc.dg/pr102892-2.c

diff --git a/gcc/testsuite/gcc.dg/pr102892-1.c b/gcc/testsuite/gcc.dg/pr102892-1.c
new file mode 100644
index 00000000000..a9302b536df
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr102892-1.c
@@ -0,0 +1,21 @@
+/* { dg-do link } */
+/* { dg-options "-O3" } */
+/* { dg-additional-sources "pr102892-2.c" } */
+
+static long b[2][1] = {0};
+
+extern void bar(void);
+extern void foo(void);
+
+int
+main ()
+{
+  long c = 0;
+  for (long a; a < 1; ++a)
+    for (; c <= 1; c++) {
+      bar();
+      if (1 == b[c][0])
+	foo();
+    }
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr102892-2.c b/gcc/testsuite/gcc.dg/pr102892-2.c
new file mode 100644
index 00000000000..b39bd6c97b3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr102892-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void
+bar (void)
+{
+}
-- 
2.33.1


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

only message in thread, other threads:[~2021-11-10 19:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 19:26 [PATCH] Add a testcase for PR tree-optimization/102892 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).