tree-optimization/108523 - testcase for the bug
authorRichard Biener <rguenther@suse.de>
Thu, 26 Jan 2023 07:38:35 +0000 (08:38 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 26 Jan 2023 07:39:27 +0000 (08:39 +0100)
This adds a reduced testcase for the PR.

PR tree-optimization/108523
* gcc.dg/torture/pr108523.c: New testcase.

gcc/testsuite/gcc.dg/torture/pr108523.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/torture/pr108523.c b/gcc/testsuite/gcc.dg/torture/pr108523.c
new file mode 100644 (file)
index 0000000..a04160b
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+int g_149, g_167, g_481;
+int main() {
+  int *l_1478 = &g_149;
+  *l_1478 ^= g_167;
+lbl_1481:
+  for (;;) {
+    g_481 = 1;
+    for (; g_481 < 100000; g_481 += 1) {
+      g_167 ^= *l_1478;
+      if (g_149)
+        goto lbl_1481;
+    }
+  }
+}