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

Roman Shaposhnick rvs
Mon Jul 30 22:49:01 CEST 2007


Hi,

On Mon, 2007-07-30 at 22:05 +0200, Alex Beregszaszi wrote:
> Hi,
> 
> > does the following code really belong to libavcodec/dsputil.c? Shouldn't
> > it be moved to configure? Or at least duplicated there as well.
> 
> I think it is ok to reside there, and anyway, it must be a message
> printed on runtime imho, to inform the user.

  Well, I might've agreed with the above statement if we have anything
in our public header that would depend on that functionality, but it
seems that once you're done compiling libav* and ffmpeg -- that's it.
You might never ever use that compiler again.

  I do agree that printing it in runtime identifies the executable
as the one with potential problems, but frankly a big WARNING message
during the configure step would achieve the same result. Warn the one
who is doing a build and not confuse somebody for whom it too late to
fix the problem anyway.

> dsputil_init itself is a good place, if we assume every SSE optimized
> code depends on dsputil.c

  Well, it might be a reasonable assumption, but it is definitely not 
a 100% one.

> > P.S. And yes, gcc 3.4.5 on RedHat 4 64bit seems to trigger this message.
> 
> That must be a bug in gcc.

  Yeah, and I've got at least two different gcc's failing on me now. The
worst of it is -- these are stock gcc compilers shipped with two major
enterprise Linux distros: RHEL4 and SLES9.

> If this fails, some SSE optims will crash.

  Not neccesseraly. The variables on the stack could be properly aligned
just by an accident.

Thanks,
Roman.





More information about the ffmpeg-devel mailing list