OSDN Git Service

arm: intreadwrite: revert 16-bit load asm to old version for gcc < 4.6
authorMans Rullgard <mans@mansr.com>
Thu, 3 May 2012 18:14:16 +0000 (19:14 +0100)
committerMans Rullgard <mans@mansr.com>
Thu, 3 May 2012 20:40:19 +0000 (21:40 +0100)
Commit adebad0 "arm: intreadwrite: fix inline asm constraints for gcc
4.6 and later" caused some older gcc versions to miscompile code.
This reverts to the old version of the code for these compilers.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavutil/arm/intreadwrite.h

index 86b93c9..ed53330 100644 (file)
@@ -30,7 +30,9 @@ static av_always_inline unsigned AV_RN16(const void *p)
 {
     const uint8_t *q = p;
     unsigned v;
-#ifdef __thumb__
+#if !AV_GCC_VERSION_AT_LEAST(4,6)
+    __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)q));
+#elif defined __thumb__
     __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(q[0]), "m"(q[1]));
 #else
     __asm__ ("ldrh %0, %1" : "=r"(v) : "Uq"(q[0]), "m"(q[1]));