]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite; Fix unprotected-allocas-1.c at -O3 [PR121684]
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Wed, 27 Aug 2025 03:57:09 +0000 (20:57 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Wed, 27 Aug 2025 05:13:12 +0000 (22:13 -0700)
The problem here is after  r16-101, the 2 functions containing alloca/VLA
start to be cloned and then we un-VLA happens in using_vararray so this
is no longer testing what it should be testing.
The obvious fix is to mark using_vararray and using_alloca as noclone too.

Pushed as obvious after a quick test to make sure it is now working.

gcc/testsuite/ChangeLog:

PR testsuite/121684
* c-c++-common/hwasan/unprotected-allocas-0.c: Mark
using_vararray and using_alloca as noclone too.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/testsuite/c-c++-common/hwasan/unprotected-allocas-0.c

index 88465155c6d0a72bfef1fdd31c59adaf4db549ce..0feca6a6d9da8bbb88b8c4627fbfdaf04cd933a7 100644 (file)
@@ -12,7 +12,7 @@
 
 char tag_of (void * x) { return ((unsigned long long)x) >> 56; }
 
-int __attribute__ ((noinline))
+int __attribute__ ((noinline,noclone))
 using_alloca (int num)
 {
   int retval = 0;
@@ -25,7 +25,7 @@ using_alloca (int num)
   return retval;
 }
 
-int __attribute__ ((noinline))
+int __attribute__ ((noinline,noclone))
 using_vararray (int num)
 {
   int retval = 0;