[FFmpeg-devel] [PATCH] ff_h[yc]scale_fast_mmext always clobbers %rbx

Nick Lewycky nlewycky at google.com
Wed May 6 20:52:59 CEST 2015

Newer versions of clang will allocate %rbx as one of the inline asm inputs,
even in PIC. This occurs when building ffmpeg with clang -fsanitize=address
-O1 -fPIE. Because the asm does clobber %bx whether PIC is on or off, just
include %bx in the clobber list regardless of whether PIC is on or off.

Patch attached, please review and apply on my behalf.


PS. While looking at this code, I have a couple more comments:
  a) What is supposed to be at -8(%rsp) that the asm saves and restores?
Doesn't this depend on whether the compiler is using %sp or %bp? A few of
us compiler engineers couldn't figure out what this is trying to do (save a
return value to %rax? but it returns void? or to save the return address of
the function? but it's never clobbered?)
  b) There's an inline comment suggesting that one variable in the inline
asm is "buf2". There is no "buf2" (did you mean "dst2" or "src2"?)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ebxsave-1.patch
Type: text/x-patch
Size: 3823 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150506/70c24769/attachment.bin>

More information about the ffmpeg-devel mailing list