New g++ ABI
Jason Merrill
jason@cygnus.com
Mon Apr 6 02:35:00 GMT 1998
>>>>> Joe Buck <jbuck@Synopsys.COM> writes:
>> I'm thinking about reducing the padding on bases down below the padding
>> that fields get, so that the next base is allocated within the padding of
>> the previous one: i.e. ...
>> Does anyone object to this optimization? It breaks
>> memset (p, 0, sizeof (P)), but that isn't guaranteed to work, and
>> will break anyway for empty classes and classes with virtual bases. But do
>> we want to break it for, say, C structs used as bases?
> We have to watch out for things like compiler-generated copy constructors
> and assignment operators, or STL allocators, doing the equivalent
> operation (of writing sizeof(P) bytes though P is a baseclass. If
> we can guarantee that this doesn't happen we're probably OK.
Good point. I guess I'll just do this for classes that need to be copied
memberwise anyway.
>> Warning: The ABI produced by -fnew-abi may vary from day to day. Do not
>> expect prolonged binary compatibility until I say otherwise.
> Depending on timing, it might be a good idea to try to combine all
> the new features that may break compatibility, e.g. -fsquangle, into
> -fnew-api.
Will do.
Jason
More information about the Gcc
mailing list