Thus spake Terry Lambert <[EMAIL PROTECTED]>:
> David Schultz wrote:
> > Thus spake Ray Kohler <[EMAIL PROTECTED]>:
> > > Has anyone tried building world/kernel with high optimizations (-O2,
> > > -O3) recently? What breaks? (Booby prize to whoever says "common sense"
> > > ;) I last tried it quite a few months ago and the resolver died on me,
> > > don't know what else. I'm not really thinking of running like that, but
> > > I am curious about others' experiences.
> > 
> > First, let me answer the question that you really meant to ask but
> > forgot to, namely, ``How much of a performance difference does -O3
> > make over -O for the kernel/world?''  The answer is ``very little,
> > for most purposes.''  So if you do use higher optimization levels,
> > at least do a little benchmarking to make sure it was worth it.
> 
> Actually, failure to use optimization suppresses some compilation
> warnings, particularly those which normally print from using some
> variables without initializing them.

I think you're thinking of dataflow analysis, which I believe gcc
does with -O and higher optimization levels.  So unless you're
using -O0, I would expect that you'd get all the warnings you
want.

> There are a number of places, particularly on non-i386 platforms,
> where optimization actually doesn't work.  I think that's why it
> was turned off for the libc compilation, and why the bug crept in.
> 
> It's probably useful to compile world with optimization occasionally,
> to make compilation-time detectable bugs like that to show up, but, as
> you point out, it'd probably be a *bad* idea to actually use the
> resulting code, at least until after the next GCC import, which will
> supposedly fix the Alpha optimizer.

Yes, the possibility of being bitten by compiler bugs is certainly
higher with higher optimization levels.  Alpha with -O2 seems to
have been broken for years, and I have seen strange things happen
on IA64 as well.  But the i386 code generators have received much
wider testing and debugging, so there is somewhat less danger there.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to