RFC: C++ PATCH to adjust empty class parameter passing ABI

Jonathan Wakely jwakely@redhat.com
Wed Apr 13 22:01:00 GMT 2016


On 12/04/16 16:27 -0400, Jason Merrill wrote:
>A revision of the patch previously posted at
>
>  https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00841.html
>
>To recap quickly, the C++ compiler has used a different calling 
>convention for passing empty classes, because C++ says they have size 
>1, while the GCC C extension gives them size 0.  But this difference 
>doesn't mean that they need to be passed differently; in either case 
>there's no actual data involved.  And the Clang folks recently pointed 
>out that if you squint properly, it seems that the x86_64 psABI says 
>that an empty class shouldn't be passed either in registers or memory. 
>H.J. had a back-end fix, but it seemed to me that a front-end fix 
>would be simpler and safer.
>
>The first patch corrects errors in what the C++ front end considers an 
>empty classes; unnamed bit-fields aren't really members.  I'm checking 
>this in now.
>
>The second patch is the actual ABI change under -fabi-version=10, 
>including a warning.  Jonathan, please check this in with your library 
>changes.

I've committed the library changes as the attached patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 18725 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20160413/2420b9fb/attachment.bin>


More information about the Libstdc++ mailing list