From 3fd32d3d22d86ab732b9b997bdabe449b8c53bbe Mon Sep 17 00:00:00 2001 From: Jakub Jelinek <jakub@redhat.com> Date: Wed, 17 Jan 2024 11:33:14 +0100 Subject: [PATCH] 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. --- .../gcc.c-torture/compile/pr110251.c | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr110251.c 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 000000000000..e2536586df81 --- /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)) + ; +} -- GitLab