From: Jakub Jelinek Date: Wed, 17 Jan 2024 10:33:14 +0000 (+0100) Subject: testsuite: Add testcase for already fixed PR [PR110251] X-Git-Tag: basepoints/gcc-15~1959 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fd32d3d22d86ab732b9b997bdabe449b8c53bbe;p=thirdparty%2Fgcc.git 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 PR tree-optimization/110251 * gcc.c-torture/compile/pr110251.c: New test. --- 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)) + ; +}