Index: third_party/libwebp/dsp/lossless.c |
diff --git a/third_party/libwebp/dsp/lossless.c b/third_party/libwebp/dsp/lossless.c |
index 84e207840515f494e0b4f81d9f7aba53297f132c..b7e02c25974b847809c3cf300ee4a998f40d8536 100644 |
--- a/third_party/libwebp/dsp/lossless.c |
+++ b/third_party/libwebp/dsp/lossless.c |
@@ -450,12 +450,21 @@ static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1, |
return ((uint32_t)a << 24) | (r << 16) | (g << 8) | b; |
} |
-static WEBP_INLINE int Sub3(int a, int b, int c) { |
+// gcc-4.9 on ARM generates incorrect code in Select() when Sub3() is inlined. |
+#if defined(__arm__) && LOCAL_GCC_VERSION == 0x409 |
+# define LOCAL_INLINE __attribute__ ((noinline)) |
+#else |
+# define LOCAL_INLINE WEBP_INLINE |
+#endif |
+ |
+static LOCAL_INLINE int Sub3(int a, int b, int c) { |
const int pb = b - c; |
const int pa = a - c; |
return abs(pb) - abs(pa); |
} |
+#undef LOCAL_INLINE |
+ |
static WEBP_INLINE uint32_t Select(uint32_t a, uint32_t b, uint32_t c) { |
const int pa_minus_pb = |
Sub3((a >> 24) , (b >> 24) , (c >> 24) ) + |