Issue 363 in webp: lossless encoding fail on arm gcc 4.8

7 views
Skip to first unread message

as… via monorail

unread,
Oct 19, 2017, 7:23:32 AM10/19/17
to webp-d...@webmproject.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 363 by as...@vewd.com: lossless encoding fail on arm gcc 4.8
https://bugs.chromium.org/p/webp/issues/detail?id=363

With libwebp v0.6.0, losseless encoding started to fail on certain images (e.g., the one on https://qual-e.appspot.com/webp.html) when libwebp is built with the arm gcc 4.8 compiler.

Could you add the 4.8 compiler to the arm gcc 4.9 compiler workaround to prevent inline of the Sub3 function in lossless.c? This code has been confirmed as working on our device:

--- a/third_party/libwebp/src/dsp/lossless.c
+++ b/third_party/libwebp/src/dsp/lossless.c
@@ -81,7 +81,7 @@ static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1,
}

// gcc-4.9 on ARM generates incorrect code in Select() when Sub3() is inlined.
-#if defined(__arm__) && LOCAL_GCC_VERSION == 0x409
+#if defined(__arm__) && (LOCAL_GCC_VERSION < 0x409 || LOCAL_GCC_VERSION == 0x408)
# define LOCAL_INLINE __attribute__ ((noinline))
#else
# define LOCAL_INLINE WEBP_INLINE


--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

as… via monorail

unread,
Oct 19, 2017, 7:37:29 AM10/19/17
to webp-d...@webmproject.org

Comment #1 on issue 363 by as...@vewd.com: lossless encoding fail on arm gcc 4.8
https://bugs.chromium.org/p/webp/issues/detail?id=363#c1

Of course I meant:


// gcc-4.9 on ARM generates incorrect code in Select() when Sub3() is inlined.
-#if defined(__arm__) && LOCAL_GCC_VERSION == 0x409
+#if defined(__arm__) && (LOCAL_GCC_VERSION == 0x409 || LOCAL_GCC_VERSION == 0x408)

# define LOCAL_INLINE __attribute__ ((noinline))
#else
# define LOCAL_INLINE WEBP_INLINE


:)

jz… via monorail

unread,
Oct 19, 2017, 3:35:44 PM10/19/17
to webp-d...@webmproject.org
Updates:
Status: Accepted

Comment #2 on issue 363 by jz...@google.com: lossless encoding fail on arm gcc 4.8
https://bugs.chromium.org/p/webp/issues/detail?id=363#c2

Thanks for the report. I think the fix should be fine, older versions of gcc were inconsistent with some of the arm code. Could you add the 'gcc --version' output here for documentation purposes?

bugdro… via monorail

unread,
Oct 20, 2017, 2:01:23 AM10/20/17
to webp-d...@webmproject.org

Comment #3 on issue 363 by bugd...@chromium.org: lossless encoding fail on arm gcc 4.8
https://bugs.chromium.org/p/webp/issues/detail?id=363#c3

The following revision refers to this bug:
https://chromium.googlesource.com/webm/libwebp/+/61e535f1ac4ad7307af1582cd669a545f661283b

commit 61e535f1ac4ad7307af1582cd669a545f661283b
Author: James Zern <jz...@google.com&gt;
Date: Thu Oct 19 20:05:48 2017

dsp/lossless: workaround gcc-4.8 bug on arm

and all older versions.
force Sub3() to not be inlined, otherwise the code in Select() will be
incorrect.

extends the check add previously in:
637b3888 dsp/lossless: workaround gcc-4.9 bug on arm

BUG=webp:363

Change-Id: I1403b558f8660b764f3a570a3326822d5ef0be29

[modify] https://crrev.com/61e535f1ac4ad7307af1582cd669a545f661283b/src/dsp/lossless.c

as… via monorail

unread,
Oct 23, 2017, 1:58:27 AM10/23/17
to webp-d...@webmproject.org

Comment #5 on issue 363 by as...@vewd.com: lossless encoding fail on arm gcc 4.8
https://bugs.chromium.org/p/webp/issues/detail?id=363#c5

Thank you!

Fix verified on gcc version 4.8.2 20131014 (prerelease)

pascal.m… via monorail

unread,
Oct 23, 2017, 3:57:36 AM10/23/17
to webp-d...@webmproject.org
Updates:
Status: Verified

Comment #6 on issue 363 by pascal.m...@gmail.com: lossless encoding fail on arm gcc 4.8
https://bugs.chromium.org/p/webp/issues/detail?id=363#c6

(No comment was entered for this change.)
Reply all
Reply to author
Forward
0 new messages