Are there any special tricks to avoiding compiler screwups?
Here is one that is bothering me right now .... Using maximum optimization, ambient sounds aren't playing until pressing ALT-TAB and switching away or back. Both using GCC and using Visual Studio. Maybe even more than that. Of course the debug build works fine.
The most aggressive optimizations don't seem to add any fps or performance, but they sure do screw up small things in subtle ways.
I've had the compiler poorly round floats so that multiplying by 100 ends up being slightly short of x 100 in multiplication against an integer before. There is a block of original Quake source code in software I have wrapped with #pragma optimize ("off") / #pragma optimize ("on") to keep the compiler from foobaring it.
Sometimes I kind of wonder whether just to use slightly less than the best optimization to prevent this kind of subtle chaos.