I had problems with gcc 2.8.0 miscompiling the kernel (X wouldn't
start, for one). I got a good advice from #linux on linuxnet, which
solved the problem. I just copied arch/i386/kernel/ioport.c from
2.1.79 to 2.0.33 tree, stripped the two SMP-related #includes
(linux/smp.h and linux/smp_lock.h) and compiled. Now it works like a charm.
This topic was discussed in egcs mailing list, and a general concensus
was that the bug is in kernel, not gcc.
Hope this helps.
Terje