aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2024-01-17 11:33:14 +0100
committerJakub Jelinek <jakub@redhat.com>2024-01-17 11:33:14 +0100
commit3fd32d3d22d86ab732b9b997bdabe449b8c53bbe (patch)
tree5e5cf474eda1f88a92f69822ff589f25aca08fdd /gcc
parent97089a54f7529a22ccfba3e59ba3b8192b0a5e18 (diff)
downloadgcc-3fd32d3d22d86ab732b9b997bdabe449b8c53bbe.zip
gcc-3fd32d3d22d86ab732b9b997bdabe449b8c53bbe.tar.gz
gcc-3fd32d3d22d86ab732b9b997bdabe449b8c53bbe.tar.bz2
testsuite: Add testcase for already fixed PR [PR110251]
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr110251.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr110251.c b/gcc/testsuite/gcc.c-torture/compile/pr110251.c
new file mode 100644
index 0000000..e253658
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr110251.c
@@ -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))
+ ;
+}