summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-10 11:56:50 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-10 11:56:50 +0100
commita18f4ba9033cec3cc435c29878b12ceef1defc1f (patch)
tree69354c3cf2f00daf0f6a91da44eb1ea858fd9d9a /src/sna
parentccf0fdd56dc6efd30e425209d753ed4f90562d76 (diff)
sna: Ofast was introduced with gcc-4.6
Thomas Jones reported that the build was failing with gcc-4.5 due to the memcpy routines requesting an unsupported optimisation mode (-Ofast) and supplied this patch to only enable Ofast for gcc-4.6+ Reported-by: Thomas Jones <thomas.jones@utoronto.ca> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/compiler.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sna/compiler.h b/src/sna/compiler.h
index 641b490c..9c1b2f1e 100644
--- a/src/sna/compiler.h
+++ b/src/sna/compiler.h
@@ -65,8 +65,10 @@
#define avx2 __attribute__((target("avx2,sse4.2,sse2,fpmath=sse")))
#endif
-#if HAS_GCC(4, 5) && defined(__OPTIMIZE__)
+#if HAS_GCC(4, 6) && defined(__OPTIMIZE__)
#define fast_memcpy __attribute__((optimize("Ofast"))) __attribute__((target("inline-all-stringops")))
+#elif HAS_GCC(4, 5) && defined(__OPTIMIZE__)
+#define fast_memcpy __attribute__((target("inline-all-stringops")))
#else
#define fast_memcpy
#endif