]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Add testcase for already fixed PR [PR110251]
authorJakub Jelinek <jakub@redhat.com>
Wed, 17 Jan 2024 10:33:14 +0000 (11:33 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 17 Jan 2024 10:33:14 +0000 (11:33 +0100)
This testcase started to hang at -O3 with r13-4208 and got fixed
with r14-2097.

2024-01-17  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/110251
* gcc.c-torture/compile/pr110251.c: New test.

gcc/testsuite/gcc.c-torture/compile/pr110251.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.c-torture/compile/pr110251.c b/gcc/testsuite/gcc.c-torture/compile/pr110251.c
new file mode 100644 (file)
index 0000000..e253658
--- /dev/null
@@ -0,0 +1,27 @@
+/* PR tree-optimization/110251 */
+
+int a, b;
+signed char c;
+
+int
+foo (int e)
+{
+  if (e >= 'a')
+    return e;
+}
+
+int
+bar (unsigned short e)
+{
+  for (; e; a++)
+    e &= e - 1;
+}
+
+void
+baz (void)
+{
+  while (c < 1)
+    ;
+  for (; bar (c - 1); b = foo (c))
+    ;
+}