The SystemZ ABI has special cases to handle structs containing just a single floating-point member. In determining this property, there are corner cases around empty fields. So for example, if a struct contains an "empty member" in addition to a member of floating-point type, the struct is still considered to contain just a single floating-point member.
In (prior versions of) C++, however, members of class type would never count as "empty" given the C++ rules that even an empty class should be considered as having a size of at least 1. But now with C++20, data members can be marked with the [[no_unique_address]] attribute, in which case that rule no longer applies. The Itanium ABI document was updated to address this new situation (https://itanium-cxx-abi.github.io/cxx-abi/abi.html#definitions):
empty class
A class with no non-static data members other than empty data members, no unnamed bit-fields other than zero-width bit-fields, no virtual functions, no virtual base classes, and no non-empty non-virtual proper base classes.empty data member
A potentially-overlapping non-static data member of empty class type.
GCC 10 has been updated across platforms to respect this new case.
This patch implements the new case in the ABI code for SystemZ. Note that I'm changing common subroutines (isEmptyField / isEmptyRecord) that are used for other ABIs as well. To prevent this patch from having any unintended effect on other platforms, I've guarded the new behavior with an extra flag that is currently only set on SystemZ.
Now I would expect that most other platforms who use isEmptyField / isEmptyRecord / isSingleElementStruct / isHomogeneousAggregate will also have to respect that new behavior in order to stay compatible with the respective system ABIs (and GCC), but I'd prefer to leave this up to the maintainers of those platforms ...
This check is being done after removal of the array types by AllowArrays, so this code is also conferring the property of being empty to arrays. It seems GCC erroneously does the same for base class fields (but not for direct members).
Compiler Explorer link: https://godbolt.org/z/NFuca9