[Ffmpeg-devel] GCC optimizations

Justin Ruggles jruggle
Sun May 28 23:24:22 CEST 2006


Guillaume POIRIER wrote:
> Hi,
> 
> On 5/28/06, Justin Ruggles <jruggle at earthlink.net> wrote:
> 
> 
>>While working on the FLAC encoder, I have come across a problem I've
>>never encountered.  I am getting completely different results using gcc
>>with optimization vs. without optimization.  Using -O0 gives me good
>>results, but using -O1 to -O3 gives bad (but still valid) results.
> 
> 
> You mean that the performance of you code decrease as you increase the
> optimization level? This seems odd. -O1, -O2, -Os should always be
> better than -O0 (which is pretty much like macro-expand).
> 

Actually, it's not the performance that's the issue.  I get different
output from the encoder.  File sizes and contents are different.

> 
>>I get the same good results using tcc.
> 
> 
> Ahem... tcc is just a fast compiler that holds in a very few number of
> lines. It should not be considered more seriously than that...
> 

Yes, but it does not do all the optimizations GCC does, and that's my
point of comparison here.

> 
>>Could I have a bug somewhere in my
>>code that would cause this or is it more likely a bug in gcc?
> 
> 
> Did you identify the file/function in your code that isn't compiled
> into fast code?
> 
> 
> 
>>My gcc
>>version is 3.3.4.
> 
> 
> In my own experience, gcc-3.3 isn't too good of a gcc milestone. Gcc
> 3.4, gcc-4.0 or 4.1 are much, much better.
> 
> Guillaume

Well...as I can't seem to narrow-down my problem, maybe upgrading is the
solution.

Thanks,
Justin





More information about the ffmpeg-devel mailing list