https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112442
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I am not 100% sure but there seems like some kind of aliasing issue going on. Basically you have a pointer to an `unsigned char` but writing it via a pointer to `char`. Yes writing to a type via `char` would be valid and well defined but you are writing to a pointer of char.