https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102296
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Oh the problem is not DECL_SIZE vs TYPE_SIZE (sorry about that) but rather:
sol2.h:
size = int_size_in_bytes (TREE_TYPE (DECL)); \
ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
vs elfos.h:
size = tree_to_uhwi (DECL_SIZE_UNIT (DECL)); \
ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
I just did a cross to x86_64-solaris2.12 and got:
.type b, @object
.size b, 4
While on x86_64-linux-gnu I get:
.type b, @object
.size b, 24
Notice the 4 vs 24.
Replacing the size calucation from elfos.h to sol2.h and we get the 24 now.