After fixing PR 39545, I got [hjl@gnu-34 pr39545]$ cat f-1.i struct line { int length; char contents[]; }; void foo (struct line); struct line bar () { struct line x; x.length = sizeof (struct line); foo (x); return x; } [hjl@gnu-34 pr39545]$ make f-1.s /export/build/gnu/gcc-avx/build-x86_64-linux/stage1-gcc/xgcc -B/export/build/gnu/gcc-avx/build-x86_64-linux/stage1-gcc/ -O2 -fno-asynchronous-unwind-tables -S -o f-1.s f-1.i f-1.i: In function ‘bar’: f-1.i:10: note: The ABI of passing struct with a flexible array member has changed in GCC 4.4 [hjl@gnu-34 pr39545]$ cat f-1.s .file "f-1.i" .text .p2align 4,,15 .globl bar .type bar, @function bar: subq $40, %rsp movl $4, 16(%rsp) movq 16(%rsp), %rdi call foo movl $4, %eax addq $40, %rsp ret .size bar, .-bar [hjl@gnu-34 pr39545]$ cat f-3.i struct line { int length; char contents[0]; }; void foo (struct line); struct line bar () { struct line x; x.length = sizeof (struct line); foo (x); return x; } [hjl@gnu-34 pr39545]$ make f-3.s /export/build/gnu/gcc-avx/build-x86_64-linux/stage1-gcc/xgcc -B/export/build/gnu/gcc-avx/build-x86_64-linux/stage1-gcc/ -O2 -fno-asynchronous-unwind-tables -S -o f-3.s f-3.i [hjl@gnu-34 pr39545]$ cat f-3.s .file "f-3.i" .text .p2align 4,,15 .globl bar .type bar, @function bar: subq $8, %rsp movl $4, %edi call foo movl $4, %eax addq $8, %rsp ret .size bar, .-bar [hjl@gnu-34 pr39545]$ With char contents[0], gcc doesn't touch stack. With char contents[], we put value on stack even if it is passed in register.
Confirmed.