From ff6c81d90cdf070bcedc77015f7c17ac07f74020 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Thu, 8 Aug 2019 14:16:36 -0700 Subject: [PATCH] Fix the build on GCC 4.x after 812e8f2a1 The ancient GCC 4.x doesn't understand the "optimize" attribute until 4.4. Fix the build on platforms with GCC 4.x < 4.4 by limiting the DONT_VECTORIZE definition to GCC 5 and greater. Noticed and patch proposed by Warner Losh . --- lib/common/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/compiler.h b/lib/common/compiler.h index 87bf51ae..d1817958 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -128,7 +128,7 @@ } /* vectorization */ -#if !defined(__clang__) && defined(__GNUC__) +#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 5 # define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) #else # define DONT_VECTORIZE