https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87373
--- Comment #14 from Richard Earnshaw <rearnsha at gcc dot gnu.org> --- (In reply to Murat Ursavaş from comment #13) > Richard, > > Also as far as I remember GNU manual was indeed saying something on this > case. It was saying that "if the struct is not packed, it would access to > members word by word. But if unaligned access is disabled, it would access > the variables byte by byte and create longer and slower images. With > unaligned access, it should access to the struct members again word by word." > > I can't show where it's written but I remember it. > > With the direct access, it is indeed accessing word by word no matter > -pack-struct option is. But if I access it indirectly with a pointer, it > tries to access byte by byte and still can't assign the values developer > want. That's because in the direct case it can see that the object is on the stack and aligned, so the value can be read simply without an unaligned object. Once the object is accessed through the pointer the knowledge of the alignment is lost and accesses have to be done more conservatively.