https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100224
--- Comment #2 from Zhao Chun <zhaoc at apache dot org> --- (In reply to Richard Biener from comment #1) > You are accessing 'double' via a pointer to uint64_t * here: > > k = *((uint64_t*)data); > > that violates type based aliasing rules. You can use -fno-strict-aliasing > to work around your bug or use > > typedef uint64_t aliasing_uint64_t __attribute__((may_alias)); > k = *((aliasing_uint64_t*)data); Thanks for your answer, it works for me. However I don't quite understand why it works after such a change. Could you please explain it more clearly?