[FFmpeg-devel] Stack variables alignment check in libavcodec/dsputil.c

Roman Shaposhnick rvs
Tue Jul 31 00:42:54 CEST 2007


On Tue, 2007-07-31 at 01:18 +0300, Uoti Urpala wrote:
> On Mon, 2007-07-30 at 14:47 -0700, Roman Shaposhnick wrote:
> > 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...
> 
> It would be less efficient. Normally GCC at least maintains stack
> alignment by making all stack frames a multiple of 16 bytes, so no
> additional code per aligned variable is needed (if you can rely on other
> programs in the call chain not breaking the alignment). Doing additional
> manual alignment like you suggested would add overhead.

  Not to start yet another gcc flame war, but I'm sick and tired
of hearing what gcc is *supposed* to do and how much better it
is supposed to be if it *works*. Well, it doesn't work, I'm sorry.
Hence the efficiency becomes moot.

 Michael, would you consider a patch with a reasonable performance
deviation to be acceptable replacement for trying to make gcc align
stack variables?

Thanks,
Roman.





More information about the ffmpeg-devel mailing list