https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105514
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Just looking at the code, there seems to be some aliasing violations going on which is causing the problem. Sometimes accessing via unsigned long and others by double. Does -fno-strict-aliasing fixes the issue?