Hi! This testcase started to be miscompiled with r16-170 and got fixed again with r16-960.
This just adds the testcase so that we don't regress it again. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2026-01-15 Jakub Jelinek <[email protected]> PR tree-optimization/120322 * gcc.dg/torture/pr120322.c: New test. --- gcc/testsuite/gcc.dg/torture/pr120322.c.jj 2026-01-14 14:48:43.493227255 +0100 +++ gcc/testsuite/gcc.dg/torture/pr120322.c 2026-01-14 14:48:30.445446273 +0100 @@ -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); +} Jakub
