This is V2 of a patch that I have sent previously: https://www.mail-archive.com/[email protected]/msg384874.html
The goal of this patch is to address a subtle way to break ABI when the [[clang::trivial_abi]] attribute is applied as documented in this feature request https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107187 Implement the trivial_abi attribute for GCC to fix ABI compatibility issues with Clang. Currently, GCC silently ignores this attribute, causing call convention mismatches when linking GCC-compiled code with Clang-compiled object files that use trivial_abi types. This attribute allows types to be treated as trivial for ABI purposes, enabling pass in registers instead of invisible references. Changes from the previous version: - There were some comments on V1 of this patch. I addressed them to the best of my ability, although I have not found a good way to consolidate CLASSTYPE_HAS_TRIVIAL_ABI with TREE_ADDRESSABLE. - Registered cleanup in callee for trivial abi `gcc/testsuite/g++.dg/abi/invisiref3a.C` - Added doc in `gcc/doc/extend.texi`. Pretty much the same as in Clang's attributes documentation. There was also a suggestion that we accept the corresponding [[clang::trivial_abi]] spelling. I believe it can be done in a separate patch. Yuxuan
0001-Add-support-for-gnu-trivial_abi-attribute.patch
Description: Binary data
