https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110368
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The code can fixed using memcpy Replace: c += *data_16++ With: unsigned tmp; memcpy(&tmp, data_16, sizeof(tmp)); data_16++; c += tmp;