[Ffmpeg-devel] GCC optimizations
Sun May 28 23:06:05 CEST 2006
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).
> 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...
> 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.
"Success consists of going from failure to failure without loss of enthusiasm."
-- Winston Churchill
More information about the ffmpeg-devel