Lou Rickard wrote:
...

I'm running RH 7.2, with RH's 2.9.6 version of gcc, on
a pentium3.


2.9.6 has a reputation for being a POS. It has been known to miscompile things (quite often in fact). It's possible that optmizations were basically disabled along the way in an attempt to combat this.

Needless to say, compiler optimizations on gcc 3.2 (I haven't gotten a chance to toy with 3.3 yet) can do some rather impressiev things. Changing from -O2 to -Os generally shaves about 25k off my kernel's bzImage (that's AFTER compression) and can make about a 10k difference in the size of my busybox images. This doesn't sound like much, but my kernels tend to be rather small (about 600-950k) and busybox pretty much maxes at 300-350k. Another great way to really save some size is to use -fomit-frame-pointer. Unfortunately this can make debugging a rather large pain.

In terms of speed, it can make a noticable difference to increase the optmization level, especially if you manually invoke some of the more dangerous options. Of course, as you pump the optimization level up or invoke more and more optimizations explicitly, the higher the chance you'll find a compiler "bug", or simply an optmization that a creatively written piece of code just doesn't like.

--MonMotha

Reply via email to