[FFmpeg-devel] Stack variables alignment check in libavcodec/dsputil.c
Mon Jul 30 23:47:04 CEST 2007
On Mon, 2007-07-30 at 23:26 +0200, Michael Niedermayer wrote:
> so the alignment check failure mean one or more of the following is true
> * stack was not aligned on entry AND gcc did not realign it
> * gcc did not maintain alignment
And that is precisely why I didn't like this stack-variable-alignment
business to begin with. Just the sheer number of cases makes me
paranoid. But I digressed...
> the gcc behavior depends at least on its version, and various options
> given to it
> the initial alignment depends on your OS and how it loads the executable
> as well as how the application which calls lavc as been compiled and
> how the thread lib has been compiled ...
I guess the only argument that I have left is that the check in
libavcodec/dsputil.c seems to be too naive to catch all these
potential issues. But then again, it is better than nothing.
Also, it seems that getting an early warning during the configure
step might still be quite beneficial for catching the potential issues
early enough. Don't you think? (And yes, now that cross-compilation
has been mentioned I do realize that configure would be able
to provide a totally reliable set of tests :-().
P.S. I wonder if a clever macro allocating +(align-1) bytes on the
stack and then coercing a pointer wouldn't be as efficient as
the current implementation relying on half-broken gcc...
More information about the ffmpeg-devel