From 233e9daff5f88f5977c4faccd5f90c208972321c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 9 Nov 2014 17:54:54 +0000 Subject: [PATCH] Fix buffer overflow in avx256-unaligned-{load|store}-7.c * testsuite/63305 * gcc.target/i386/avx256-unaligned-load-7.c (avx_test): Fix buffer overflow. * gcc.target/i386/avx256-unaligned-store-7.c (avx_test): Likewise. From-SVN: r217267 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.target/i386/avx256-unaligned-load-7.c | 6 +++--- gcc/testsuite/gcc.target/i386/avx256-unaligned-store-7.c | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0e469f0c2c0..e7f0b221b9c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2014-11-09 H.J. Lu + + * testsuite/63305 + * gcc.target/i386/avx256-unaligned-load-7.c (avx_test): Fix + buffer overflow. + * gcc.target/i386/avx256-unaligned-store-7.c (avx_test): Likewise. + 2014-11-09 Andreas Schwab * gcc.target/powerpc/pr51623.c: Fix implicit declarations. diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-7.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-7.c index 4a94e0359ff..4c6054c0ff6 100644 --- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-7.c +++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-7.c @@ -34,7 +34,7 @@ avx_test (void) cp = mp; dp = lp; - for (i = N; i >= 0; i--) + for (i = N; i > 0; i--) { *cp++ = str; *dp++ = str; @@ -45,13 +45,13 @@ avx_test (void) cp = mp; dp = lp; - for (i = N; i >= 0; i--) + for (i = N; i > 0; i--) { *ap++ = *cp++; *bp++ = *dp++; } - for (i = N; i >= 0; i--) + for (i = N; i > 0; i--) { if (strcmp (*--ap, "STR") != 0) abort (); diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-7.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-7.c index 85e387a4ea5..99a0c719753 100644 --- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-7.c +++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-7.c @@ -30,13 +30,13 @@ avx_test (void) ap = ep; bp = fp; - for (i = N; i >= 0; i--) + for (i = N; i > 0; i--) { *ap++ = str; *bp++ = str; } - for (i = N; i >= 0; i--) + for (i = N; i > 0; i--) { if (strcmp (*--ap, "STR") != 0) abort (); -- 2.30.2