[FFmpeg-devel] [PATCH] get_cabac_inline_x86: workaround clang bug with disabled optimizations

Michael Niedermayer michaelni at gmx.at
Sat Sep 15 22:38:13 CEST 2012


gcc produces binary identical output relative to before this change

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/x86/cabac.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/x86/cabac.h b/libavcodec/x86/cabac.h
index dbac83f..35f4ca7 100644
--- a/libavcodec/x86/cabac.h
+++ b/libavcodec/x86/cabac.h
@@ -174,11 +174,12 @@ static av_always_inline int get_cabac_inline_x86(CABACContext *c,
                              AV_STRINGIFY(H264_LPS_RANGE_OFFSET),
                              AV_STRINGIFY(H264_MLPS_STATE_OFFSET),
                              "%8")
-        : "=&r"(bit), "+&r"(c->low), "+&r"(c->range), "=&q"(tmp)
+        : "=&r"(bit), "=&r"(c->low), "=&r"(c->range), "=&q"(tmp)
         : "r"(state), "r"(c),
           "i"(offsetof(CABACContext, bytestream)),
           "i"(offsetof(CABACContext, bytestream_end))
           TABLES_ARG
+          ,"1"(c->low), "2"(c->range)
         : "%"REG_c, "memory"
     );
     return bit & 1;
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list