4.0.5's use of "restrict" keyword in altivec kernel breaks GCC compilers
4.0.5 added the "restrict" keyword to various parts of the PPC AltiVec-specific kernels. The release notes say this was done to fix a compile failure with IBM Xlc 10.1, but it now breaks with GCC 4.x, which does not recognize restrict unless specifically put in C99 mode.
A possible workaround:
--- ppc_altivec_util.h.orig 2009-05-14 17:12:46.000000000 -0700
+++ ppc_altivec_util.h 2009-05-14 17:13:56.000000000 -0700
@ -41,6 +41,13 @
* always works.
#define restrict __restrict
/* Write contents of a SIMD FP variable on standard out. * * @internal
#1 Updated by Jussi Lehtola over 10 years ago
OK, this is probably the reason why 4.0.5 fails to compile on RedHat 4, 5 and Fedora 9 - 11 at the moment:
#2 Updated by Erik Lindahl over 10 years ago
Sorry about that, will fix. However, instead of a gcc-only fix we'll introduce a gmx_restrict, which is defined to restrict, __restrict, or empty if not supported.
(The restrict modifier is important, since this makes IBM xlc just as fast as xlf, and then we can retire fortran in the future...)