https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64755
--- Comment #3 from mednafen at gmail dot com --- It looks like your code violates strict aliasing rules. Does the code in question work as you intend it to if you compile with -fno-strict-aliasing ?