https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119931
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> yes this is a testcae issue but neither noipa nor -fno-ipa-cp is correct
> here.
> The testcase is no longer testing what originally going wrong either.
>
> Maybe it should search for `# DEBUG i => 5` now.
Disagree, then it doesn't check what it was written originally for.
I think we should use following in the caller instead, then it is clearly
optimized away, don't know what it contains, so ask caller if it can figure out
what the value was.
2025-11-24 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.
--- gcc/testsuite/gcc.dg/vla-1.c.jj 2023-12-01 08:10:43.980306583 +0100
+++ gcc/testsuite/gcc.dg/vla-1.c 2025-11-24 11:11:12.364719774 +0100
@@ -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" } } */
-