https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66661
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Pádraig Brady from comment #4) > I should note that I worked around the issue by increasing the allocation > for the structure on the heap up to a multiple of alignof(the_struct). See: > http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=49078a78 That is not just a workaround but a correct patch. The size of the memory allocated needs to be a multiply of the alignment of the struct to be valid. The reason why it works for you with your reduced testcase is because the alignment of the struct is 1.