[Bug middle-end/28865] Structures with a flexible arrray member have wrong .size
nickc at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jan 10 16:53:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865
--- Comment #15 from Nick Clifton <nickc at gcc dot gnu.org> ---
Created attachment 31802
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31802&action=edit
Fix gcc's emission of assembler directives for a variable length structure
Hi Guys,
I think that the problem is the output_constant function in varasm.c which is
given a target size, but which can emit more bytes than expected if the
expression is a variable length structure.
This patch updates output_constant so that it returns the number of bytes
that it really did emit, and it updates a couple of places where
output_constant is used so that this corrected size is taken into account.
Tested without regressions on an i686-pc-linux-gnu toolchain and an
aarch64-elf toolchain. Does anyone have any objections to my submitting the
patch to gcc-patches ?
Cheers
Nick
More information about the Gcc-bugs
mailing list