I thought you were right, but I tested it on x86_64 GNU/Linux with this struct:
struct ts {
int32_t dword1;
int64_t qword1;
int32_t dword2;
};
Writing -1 to all 3 members and printing out the individual bytes up to sizeof(struct ts), it produces this with -O0 and -O3:
FF FF FF FF 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00
With -Os, I get some garbage data after the last member (always those 2 byte positions, with different values every time):
FF FF FF FF 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF 45 76 00 00
I feel like I'm missing something obvious here. Or maybe my system's ABI is a weird exception.