]> git.ipfire.org Git - thirdparty/gcc.git/commit
Darwin, PPC: Fix struct layout with pragma pack [PR110044].
authorIain Sandoe <iain@sandoe.co.uk>
Thu, 1 Jun 2023 12:43:35 +0000 (13:43 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 9 Jun 2023 08:19:25 +0000 (09:19 +0100)
commit8d64b55db0bec62873503739fabc2a4d3219ad58
tree8f7ee053edbdab15cf406f2486250fe70ea201df
parentbc4adb88611cb17280ab15ac4e13ab1d05b11825
Darwin, PPC: Fix struct layout with pragma pack [PR110044].

This bug was essentially that darwin_rs6000_special_round_type_align()
was ignoring externally-imposed capping of field alignment.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR target/110044

gcc/ChangeLog:

* config/rs6000/rs6000.cc (darwin_rs6000_special_round_type_align):
Make sure that we do not have a cap on field alignment before altering
the struct layout based on the type alignment of the first entry.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/darwin-abi-13-0.c: New test.
* gcc.target/powerpc/darwin-abi-13-1.c: New test.
* gcc.target/powerpc/darwin-abi-13-2.c: New test.
* gcc.target/powerpc/darwin-structs-0.h: New test.

(cherry picked from commit 84d080a29a780973bef47171ba708ae2f7b4ee47)
gcc/config/rs6000/rs6000.cc
gcc/testsuite/gcc.target/powerpc/darwin-abi-13-0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/darwin-abi-13-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/darwin-abi-13-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/darwin-structs-0.h [new file with mode: 0644]