As a temporary workaround until a proper solution can be found I suggest setting -fno-strict-aliasing for this particular code with a #pragma. This is further guarded so that it will only be applied for the accuracy profile and gcc newer than 7. I tested this with both gcc and clang where it compiled correctly.
When compiled with gcc7, the bsnes-accuracy core will enter an infinite loop while compiling this code with
-fstrict-aliasing
.This specifically happens with
return x;
.As a temporary workaround until a proper solution can be found I suggest setting
-fno-strict-aliasing
for this particular code with a#pragma
. This is further guarded so that it will only be applied for the accuracy profile and gcc newer than 7. I tested this with both gcc and clang where it compiled correctly.See this issue for more information. https://github.com/libretro/bsnes-mercury/issues/47