From: Julian Seward Date: Wed, 27 Apr 2011 23:25:15 +0000 (+0000) Subject: Change the default (minimum) client malloc alignment from 8 to 16 X-Git-Tag: svn/VALGRIND_3_7_0~522 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6045181f3c332cb6d646d94124a96cb975864918;p=thirdparty%2Fvalgrind.git Change the default (minimum) client malloc alignment from 8 to 16 on ppc32-linux. This is needed to make Altivec-using code work correctly. Noticed when running ./auxprogs/gsl16test with gcc-4.6 with args -mcpu=970 -g -O3 -ftree-vectorize on Memcheck, in which case a few of the tests failed because malloc() returns 8 byte aligned memory when it should return 16-aligned memory. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11715 --- diff --git a/coregrind/pub_core_mallocfree.h b/coregrind/pub_core_mallocfree.h index 7c3cbb139d..1af76ec0ed 100644 --- a/coregrind/pub_core_mallocfree.h +++ b/coregrind/pub_core_mallocfree.h @@ -70,12 +70,14 @@ typedef Int ArenaId; // minimum alignment. Must be a power of 2 greater than 4, and should be // greater than 8. #if defined(VGP_x86_linux) || \ - defined(VGP_ppc32_linux) || \ defined(VGP_arm_linux) # define VG_MIN_MALLOC_SZB 8 // Nb: We always use 16 bytes for Darwin, even on 32-bits, so it can be used // for any AltiVec- or SSE-related type. This matches the Darwin libc. +// Also, use 16 bytes for any PPC variant, since 16 is required to make +// Altiveccery work right. #elif defined(VGP_amd64_linux) || \ + defined(VGP_ppc32_linux) || \ defined(VGP_ppc64_linux) || \ defined(VGP_s390x_linux) || \ defined(VGP_ppc64_aix5) || \