rs6000: Add psabi diagnostic for C++ zero-width bit field ABI change
commit16e3d6b8b2b5168ebc773833f0e7ccf2191932c1
authorBill Schmidt <wschmidt@linux.ibm.com>
Thu, 23 Sep 2021 12:35:42 +0000 (23 07:35 -0500)
committerBill Schmidt <wschmidt@linux.ibm.com>
Thu, 23 Sep 2021 12:40:34 +0000 (23 07:40 -0500)
treeace3890d9b8d93efe6710561fecae58d8e7d1721
parent00446916206cbf9812a92b418090919515289a20
rs6000: Add psabi diagnostic for C++ zero-width bit field ABI change

Previously zero-width bit fields were removed from structs, so that otherwise
homogeneous aggregates were treated as such and passed in FPRs and VSRs.
This was incorrect behavior per the ELFv2 ABI. Now that these fields are no
longer being removed, we generate the correct parameter passing code.  Alert
the unwary user in the rare cases where this behavior changes.

2021-09-23  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
PR target/102024
* config/rs6000/rs6000-call.c (rs6000_aggregate_candidate): Detect
zero-width bit fields and return indicator.
(rs6000_discover_homogeneous_aggregate): Diagnose when the
presence of a zero-width bit field changes parameter passing in
GCC 12.

gcc/testsuite/
PR target/102024
* g++.target/powerpc/pr102024.C: New.
gcc/config/rs6000/rs6000-call.c
gcc/testsuite/g++.target/powerpc/pr102024.C [new file with mode: 0644]