From: Iain Sandoe Date: Sat, 13 Nov 2021 11:58:09 +0000 (+0000) Subject: testsuite, Darwin: In tsvc.h, use malloc for Darwin <= 9. X-Git-Tag: basepoints/gcc-13~3034 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bd5159bdd4f26ea6e01c1411149e8e2eaec62531;p=thirdparty%2Fgcc.git testsuite, Darwin: In tsvc.h, use malloc for Darwin <= 9. Earlier Darwin versions fdo not have posix_memalign() but the malloc implementation is guaranteed to produce memory suitably aligned for the largest vector type. Signed-off-by: Iain Sandoe gcc/testsuite/ChangeLog: * gcc.dg/vect/tsvc/tsvc.h: Use malloc for Darwin 9 and earlier. --- diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h index 63ea1e2601fb..665ca747f8e0 100644 --- a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h +++ b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h @@ -193,8 +193,16 @@ void init(int** ip, real_t* s1, real_t* s2){ xx = (real_t*) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t)); *ip = (int *) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t)); #else +# if defined (__APPLE__) \ + && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060 + /* We have no aligned allocator, but malloc is guaranteed to return + alignment suitable for the largest vector item. */ + xx = (real_t*) malloc (LEN_1D*sizeof(real_t)); + *ip = (int *) malloc (LEN_1D*sizeof(real_t)); +# else posix_memalign ((void*)&xx, ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t)); posix_memalign ((void*)ip, ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t)); +# endif #endif for (int i = 0; i < LEN_1D; i = i+5){