https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113977
--- Comment #4 from Tan Senqi <tsqurt at outlook dot com> --- (In reply to Andrew Pinski from comment #3) > For me with the trunk GCC we get: > ``` > (gdb) expr z[0]._[0] = 1 > gdb command line:1:1: error: size of array element is not a multiple of its > alignment > Compilation failed. > (gdb) expr y[0]._[0] = 1 > (gdb) expr x[0]._[0] = 1 > gdb command line:1:1: error: alignment of array elements is greater than > element size > Compilation failed. > > ``` > > I am starting to think this is a gdb issue ... I think gcc can generate a DW_AT_alignment for my struct to solve this problem. But why the alignment is considered as 8, I am not sure about this. If it is inherited from the default structure alignment requirement on the platform, then gcc should specify alignment for those whose alignment is not 8. Or 8 is not the default value by DWARF5(i.e. undefined), then it is surely a bug in gdb.