Re: Why not 03 ?
Xavier Roche <xavier@debian.org> writes:
> I have a rather silly question: most (all ?) packages are built by
> default with -02 - something which is inherited from autotool's '-g -O2'
> default flagsd, I presume.
> Is -O3 considered too dangerous ? (AFAICS, potential issues are mainly
> present in O2) Or is it considered worthless because the performance
> gain would be really low ?
Historically, -O3 has usually been slower than -O2 for a lot of software
because the aggressive loop unrolling increases code size and interferes
with processor caching strategies. I don't know if that's now been fixed
in GCC, but that's probably much of the historical reason.
My impression is that most people using GCC use -O2, so it's the
best-tested path.
--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>
Reply to: