This is an archive of the discontinued LLVM Phabricator instance.

Itanium ABI: Pack non-pod members of packed types
ClosedPublic

Authored by dblaikie on Oct 13 2022, 1:59 PM.

Details

Summary

Seems there's a narrow case - where a packed type doesn't pack its base
subobjects (only fields), but when packing a field of the derived type,
GCC does pack the resulting total object - effectively packing the base
subobject.

So ensure that this non-pod type (owing to it having a base class) that
is packed, gets packed when placed in /another/ type that is also
packed.

This is a (smallish?) ABI fix to a regression introduced by D117616 -
but that regression/ABI break hasn't been released in LLVM as-yet (it's
been reverted on the release branch from the last two LLVM releases - I
probably should've just reverted the whole patch while we hashed out
this and other issues) so this change isn't itself an ABI break, as far
as LLVM releases are concerned (for folks releasing their own copies of
LLVM from ToT/without the LLVM release branch, and didn't opt into the
clang-abi-compat 14 or below (soon to be 15 or below, I guess I should
say) then this would be an ABI break against clang from the last 9
months or so)

Diff Detail

Event Timeline

dblaikie created this revision.Oct 13 2022, 1:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2022, 1:59 PM
dblaikie requested review of this revision.Oct 13 2022, 1:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2022, 1:59 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dblaikie added a project: Restricted Project.Oct 13 2022, 1:59 PM
This revision is now accepted and ready to land.Oct 14 2022, 12:13 PM
This revision was automatically updated to reflect the committed changes.