From 049b8574b450eb7f2bc7131d7dabe98af64594dc Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Tue, 28 Jan 2014 02:43:21 +0100 Subject: [PATCH] Keep clang Address Sanitizer happy Allocating 15 bytes with the 8-byte aligned memory at offset 8 of 15, would overflow the buffer, which would be fairly likely to have no effect. But ASan notices this if you run it on AVX hardware, unlike the Jenkins build which runs on SSE4.1. The good news is that this fix is enough to make all the existing tests pass under ASan on AVX. Change-Id: I61ff11687709e096c70a162d3514227cb243561d --- .../nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h b/src/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h index b306733a27..f041a5c9d8 100644 --- a/src/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h +++ b/src/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2009, The GROMACS Development Team - * Copyright (c) 2012,2013, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014 by the GROMACS development team, led by * David van der Spoel, Berk Hess, Erik Lindahl, and including many * others, as listed in the AUTHORS file in the top-level source * directory and at http://www.gromacs.org. @@ -177,11 +177,11 @@ gmx_mm_pr sh_invrc6_S, sh_invrc12_S; /* cppcheck-suppress unassignedVariable */ - real tmpsum_array[15], *tmpsum; + real tmpsum_array[GMX_SIMD_WIDTH_HERE*2], *tmpsum; #endif #ifdef CALC_SHIFTFORCES /* cppcheck-suppress unassignedVariable */ - real shf_array[15], *shf; + real shf_array[GMX_SIMD_WIDTH_HERE*2], *shf; #endif int ninner; -- 2.22.0