testsuite: fix vect.exp ASAN errors

Message ID a2623fc2-3394-a338-59c2-f6c7bbd0589a@suse.cz
State New
Headers
Series testsuite: fix vect.exp ASAN errors |

Commit Message

Martin Liška Dec. 15, 2021, 1:24 p.m. UTC
  The patch fixes a few ASAN errors (global variable access out of bounds).

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/vect-simd-18.c: Fix ASAN error.
	* gcc.dg/vect/vect-simd-19.c: Likewise.
	* gcc.dg/vect/vect-simd-20.c: Likewise.
---
  gcc/testsuite/gcc.dg/vect/vect-simd-18.c | 2 +-
  gcc/testsuite/gcc.dg/vect/vect-simd-19.c | 2 +-
  gcc/testsuite/gcc.dg/vect/vect-simd-20.c | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
  

Comments

Martin Liška Jan. 3, 2022, 11:45 a.m. UTC | #1
On 12/15/21 14:24, Martin Liška wrote:
> Ready to be installed?

I'm going to install this as it's quite obvious.

Martin
  

Patch

diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-18.c b/gcc/testsuite/gcc.dg/vect/vect-simd-18.c
index b25f5a5cd31..cca350f5c21 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-18.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-18.c
@@ -17,7 +17,7 @@  foo (int s, int *p)
    return r;
  }
  
-int p[10000 / 78];
+int p[10000 / 78 + 1];
  
  int
  main ()
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-19.c b/gcc/testsuite/gcc.dg/vect/vect-simd-19.c
index a71dfa676d8..67e25c0e07e 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-19.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-19.c
@@ -17,7 +17,7 @@  foo (int s, int m, int n, int *p)
    return r;
  }
  
-int p[10000 / 78];
+int p[10000 / 78 + 1];
  
  int
  main ()
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-20.c b/gcc/testsuite/gcc.dg/vect/vect-simd-20.c
index c85f05f61c6..35546ba5a23 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-20.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-20.c
@@ -18,7 +18,7 @@  foo (int s, int m, int n, int *p)
    return r;
  }
  
-int p[10000 / 78 * 7];
+int p[(10000 / 78 + 1) * 7];
  
  int
  main ()