]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix overflow in gcc.dg/vect/pr116125.c
authorSiddhesh Poyarekar <siddhesh@gotplt.org>
Mon, 21 Jul 2025 01:13:20 +0000 (06:43 +0530)
committerSiddhesh Poyarekar <siddhesh@gotplt.org>
Wed, 23 Jul 2025 02:46:55 +0000 (08:16 +0530)
The test ends up writing a byte beyond bounds of the buffer, which gets
trapped on some targets when the test is run with
-fstack-protector-strong.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/pr116125.c (mem_overlap): Expand A to 10 members.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
gcc/testsuite/gcc.dg/vect/pr116125.c

index eab9efdc061b48c72895b7ea176b1e05a0c12d75..1b882ec4002b6e426bab12a030d689ee97ac072c 100644 (file)
@@ -17,12 +17,12 @@ main (void)
 {
   check_vect ();
 
-  struct st a[9] = {};
+  struct st a[10] = {};
 
-  // input a = 0, 0, 0, 0, 0, 0, 0, 0, 0
+  // input a = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
   mem_overlap (&a[1], a);
 
-  // output a = 0, 1, 2, 3, 4, 5, 6, 7, 8
+  // output a = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
   if (a[2].num == 2)
     return 0;
   else