Bloated Struct Problem

Ian Lance Taylor iant@google.com
Sat Jun 6 04:47:00 GMT 2009


". ." <pkejjy@gmail.com> writes:

> On Fri, Jun 5, 2009 at 5:30 PM, Ian Lance Taylor<iant@google.com> wrote:
>> ". ." <pkejjy@gmail.com> writes:
>>
>>> (In other words, I think the default for x86(-64) should be packed,
>>> but I'll leave it to others to have that flame war.)
>>
>> The ABI can not change.  Changing that now would prevent linking object
>> files compiler by different compilers together safely, as they would use
>> different offsets for accessing struct fields.
>
> Yuck -- I see your point.  But, there could still be a commandline
> switch to pack all structs (like -Os, but for data).  No, I don't
> expect anyone to actually create this anytime soon, but it would be a
> handy tool for manycore optimization endeavors.

The command line option is -fpack-struct.

Ian



More information about the Gcc-help mailing list