https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105514
--- Comment #2 from chenglulu <chenglulu at loongson dot cn> --- (In reply to Andrew Pinski from comment #1) > 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? After adding the compile option '-fno-strict-aliasing', the program runs without problems. But I don't understand why one print affects so much? Thanks!