[FFmpeg-devel] [PATCH] fix h264_deblock_sse2.asm segfaults on clang/x86-32

Reimar Döffinger Reimar.Doeffinger
Wed Sep 1 08:41:11 CEST 2010

On Tue, Aug 31, 2010 at 11:28:07PM -0700, Eli Friedman wrote:
> On Tue, Aug 31, 2010 at 11:21 PM, Reimar D?ffinger
> <Reimar.Doeffinger at gmx.de> wrote:
> > On Wed, Sep 01, 2010 at 02:08:35AM -0400, Alexander Strange wrote:
> >> clang on linux/freebsd assumes 4-byte alignment, realigns to 16-byte on entry with attribute_align_arg, but only attempts to retain 4-byte alignment. So any callee code needing an aligned stack and using clang on freebsd/linux needs to realign it themselves.
> >
> > My point is about 16-byte aligned stack variables.
> > We use those, and with that approach clang can only work either not at all or
> > inefficiently with those which is why I am raising the question whether we should
> > add possibly slower and more complex code when we maybe won't be able to make all of
> > FFmpeg work anyway with that compiler.
> By default, clang will automatically realign the stack for functions
> which use variables requiring 16 or more bytes of alignment.

Will it do it at least a bit more sanely if calling lots of static functions
with aligned variables for a single function?
Or will it realign the stack over and over? In that case I am still
unsure if we shouldn't wait until they decide on a reasonable way
of handling it.
(though unless compiling with -Os I really don't think it is sane
to break stack alignment anyway)

More information about the ffmpeg-devel mailing list