]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix the build on GCC 4.x after 812e8f2a1 1713/head
authorConrad Meyer <cem@FreeBSD.org>
Thu, 8 Aug 2019 21:16:36 +0000 (14:16 -0700)
committerConrad Meyer <cem@FreeBSD.org>
Fri, 9 Aug 2019 00:25:49 +0000 (17:25 -0700)
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 <imp@FreeBSD.org>.

lib/common/compiler.h

index 87bf51ae8c896c1af9411d214a2e2c9a9e04f07a..d18179582259a36a9774f0eae6194d400d2c7edc 100644 (file)
 }
 
 /* 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