https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90668
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > If the size of int and void* are the same, I would say there is an issue. > Otherwise there is undefined behavior going on. > > The reason for the difference in sizes matter is because you write via void* > and then read the second half via int. I mean when n is non-1. Note your testcase is also dependent on the endian order of the target if sizeof(void*)!=sizeof(int).