Created attachment 31771 [details] test case to demonstrate the problem - effective on targets which use section anchors When gcc emits assembler directives to describe a union containing a variable length array it tries to ensure that the end of the union is correctly aligned, but it ends up emitting an incorrectly sized .zero pseudo-op. For example in the uploaded testcase, when compiled with an x86 toolchain, the variable first_var_union is described in the assembler output as: .type first_var_union, @object .size first_var_union, 20 first_var_union: .zero 4 .string "12-octet-str" .zero 16 Note how the size of the variable is set to 20, but the actual size is 4+13+16=33 bytes. Presumably the second .zero directive should have been ".zero 3". This might just be a curiosity were it not for the fact that it makes any following variables unaligned (unless the size of the union just happens to fir into an alignment category). Plus for targets which use section anchors (eg aarch64, arm, ppc, mips), the computation of the offset to variables beyond the variable length union will be based upon the expected size (20) not the real size (33).
Related to / dup of PR28865 and PR57180 ?
Dup. *** This bug has been marked as a duplicate of bug 28865 ***