From ce52d8847ea9f0a105a67f5a746ba1dcb998f534 Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Tue, 31 Mar 2015 08:24:38 +0000 Subject: [PATCH] re PR target/65602 (gcc.target/i386/mpx tests FAIL) PR target/65602 * gcc.target/i386/mpx/alloca-1-lbv.c (mpx_test): Use __builtin_alloca instead of alloca. * gcc.target/i386/mpx/alloca-1-nov.c (mpx_test): Likewise. * gcc.target/i386/mpx/alloca-1-ubv.c (mpx_test): Likewise. * lib/mpx-dg.exp (check_effective_target_mpx): Add wrapper check. From-SVN: r221787 --- gcc/testsuite/ChangeLog | 10 ++++++++++ gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c | 2 +- gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c | 2 +- gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c | 2 +- gcc/testsuite/lib/mpx-dg.exp | 8 +++++++- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 708d8c65ad4..04b5fadb94d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2015-03-31 Ilya Enkovich + + PR target/65602 + * gcc.target/i386/mpx/alloca-1-lbv.c (mpx_test): Use + __builtin_alloca instead of alloca. + * gcc.target/i386/mpx/alloca-1-nov.c (mpx_test): Likewise. + * gcc.target/i386/mpx/alloca-1-ubv.c (mpx_test): Likewise. + * lib/mpx-dg.exp (check_effective_target_mpx): Add wrapper + check. + 2015-03-30 Jakub Jelinek PR ipa/65610 diff --git a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c index f81a5e25f32..57c05d33f89 100644 --- a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c +++ b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c @@ -16,7 +16,7 @@ int rd (int *p, int i) int mpx_test (int argc, const char **argv) { - int *buf = (int *)alloca (100 * sizeof(int)); + int *buf = (int *)__buitlin_alloca (100 * sizeof(int)); rd (buf, -1); diff --git a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c index 162b4d57270..835015fc432 100644 --- a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c +++ b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c @@ -13,7 +13,7 @@ int rd (int *p, int i) int mpx_test (int argc, const char **argv) { - int *buf = (int *)alloca (100 * sizeof(int)); + int *buf = (int *)__builtin_alloca (100 * sizeof(int)); rd (buf, 0); rd (buf, 99); diff --git a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c index 9af3f11ac49..c57c6c4811f 100644 --- a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c +++ b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c @@ -16,7 +16,7 @@ int rd (int *p, int i) int mpx_test (int argc, const char **argv) { - int *buf = (int *)alloca (100 * sizeof(int)); + int *buf = (int *)__builtin_alloca (100 * sizeof(int)); rd (buf, 100); diff --git a/gcc/testsuite/lib/mpx-dg.exp b/gcc/testsuite/lib/mpx-dg.exp index 0b731a7ee46..c8f64cddd27 100644 --- a/gcc/testsuite/lib/mpx-dg.exp +++ b/gcc/testsuite/lib/mpx-dg.exp @@ -20,7 +20,13 @@ proc check_effective_target_mpx {} { return [check_no_compiler_messages mpx executable { int *foo (int *arg) { return arg; } - int main (void) { return foo ((void *)0) == 0; } + int main (void) + { + int *p = __builtin_malloc (sizeof (int)); + int res = foo (p) == 0; + __builtin_free (p); + return res; + } } "-fcheck-pointer-bounds -mmpx"] }