https://gcc.gnu.org/g:b12d834aab36fc7fafa15fc1ad00f5b0bc80bd3d
commit r16-6794-gb12d834aab36fc7fafa15fc1ad00f5b0bc80bd3d Author: Jakub Jelinek <[email protected]> Date: Thu Jan 15 07:46:24 2026 +0100 testsuite: Add testcase for already fixed PR [PR120322] This testcase started to be miscompiled with r16-170 and got fixed again with r16-960. 2026-01-15 Jakub Jelinek <[email protected]> PR tree-optimization/120322 * gcc.dg/torture/pr120322.c: New test. Diff: --- gcc/testsuite/gcc.dg/torture/pr120322.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/gcc/testsuite/gcc.dg/torture/pr120322.c b/gcc/testsuite/gcc.dg/torture/pr120322.c new file mode 100644 index 000000000000..8697c28c9ae3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr120322.c @@ -0,0 +1,33 @@ +/* PR tree-optimization/120322 */ +/* { dg-do run } */ +/* { dg-additional-options "-fno-early-inlining" } */ + +int a, b, c; + +void +foo (int e) +{ + if (e > 0) + while (b) + ; +} + +void +bar (unsigned short e) +{ + foo (e); +} + +static void +baz (short e) +{ + bar (e); + c = a; +} + +int +main () +{ + if (sizeof (int) > sizeof (short)) + baz (-1); +}
