derhass wrote:gcc-4.7 with optimizations turned on seems to have some alignment issues, the game might crash with SIGBUS anytime, with the kernel complaing:
- Code: Select all
[ 183.220793] Alignment trap: not handling instruction edd16a01 at [<000c2acc>]
[ 183.228520] Unhandled fault: alignment exception (0x011) at 0x00eed33a
OK, this is not gcc's fault. It is just not guaranteed by the game logic that some values are aligned. Fortunately, the game already has some #ifdef codepaths which seem to do exactly what we need, so I updated my patch to add that preprocessor definition. My binaries are also updated, now compiled with gcc-4.7. Everything seems to work fine, so far.
I'm still confused why this did not happen with gcc-4.6 (although I was able to reproduce it when I compiled with -Os).