GCC 2.93 vs. 4.0+

A long time from now, Haiku will move to GCC 4.x. What are the difficulties to this? Does this simply mean modifying code here and there or a big rewrite. I know that moving to 4.x will break compatibly will old BeOS software but are there significant benefits? Is it possible to have Haiku compile on 2.93 and 4.x at the same time depending if you want speed or compatibilities? It seems to me when Haiku is compiled on GCC 4.x you get almost “free” speed when compared to the work needed.

As a side note, does Haiku build with -o3? Will it ever?

Just some “what if” questions for down the road.

Assuming that the code is written properly, it should just be a matter a rebuilding with the new compiler. The new compilers are more strict about rules and better at checking them, so some build errors might crop up for stuff that fudged the rules. In that case, some work would need to be done to fix the applications, but once they were fixed, they should build with either compiler. The main thing is that on Haiku built with the old compiler, the applications must be built using the old compiler, and for Haiku build with the new compiler, the applications must be built with the new compiler. I don’t know what has been investigated in terms of optimization flags, but if the code and the compiler are both written properly, anything ought to build with -o3. That doesn’t necessarily mean that we will want to build with -o3. I have seen examples where code ran faster when using -o2 than with -o3. Of course, making sure that the code is written to be efficient normally yields far more benefit than those compile options.

This a little off topic but, are you the same pagefault as works on zsnes? ;]