https://gcc.gnu.org/g:d84552e1f67cb44f6b337fcf0e338b5b3571c209
commit r16-5578-gd84552e1f67cb44f6b337fcf0e338b5b3571c209 Author: Jakub Jelinek <[email protected]> Date: Tue Nov 25 11:18:07 2025 +0100 testsuite: Fix up vla-1.c test [PR119931] From what I can see, the vla-1.c test has been added to test the handling of debug info for optimized out parameters. But recent changes don't make the argument optimized away, but optimized away and replaced by constant 5 (even without IPA-VRP). The function is noinline, but can't be noclone nor noipa exactly because we want to test how it behaves when it is cloned and the unused argument is dropped. So, the following patch arranges to hide from the IPA optimizations the value of x in the caller (and even make sure it is preserved in a register or stack slot in the caller across the call). 2025-11-25 Jakub Jelinek <[email protected]> PR testsuite/119931 * gcc.dg/vla-1.c (main): Hide x value from optimizers and use it after the call as well. Diff: --- gcc/testsuite/gcc.dg/vla-1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/vla-1.c b/gcc/testsuite/gcc.dg/vla-1.c index d16e73d1dc3a..2ab2b7a48acf 100644 --- a/gcc/testsuite/gcc.dg/vla-1.c +++ b/gcc/testsuite/gcc.dg/vla-1.c @@ -16,11 +16,12 @@ main () { volatile int j; int x = 5; + asm volatile ("" : "+r" (x)); j = f1 (x); + asm volatile ("" : "+r" (x)); return 0; } /* One debug source bind is generated for the parameter, and one to describe the sizes of a and b. */ /* { dg-final { scan-tree-dump-times " s=> i" 2 "optimized" } } */ -
