aarch64: Fix an ICE in register_tuple_type [PR95523]
authorz00219097 <z.zhanghaijian@huawei.com>
Wed, 10 Jun 2020 15:58:51 +0000 (16:58 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 10 Jun 2020 15:58:51 +0000 (16:58 +0100)
commitb5cebc9ab7f6ab47067dc04cae17bf9921a62a18
treee41535801805795be27e5db08ac29cd93fb2e361
parent73266be246a1bf1781b8ef6ee1395e8602681350
aarch64: Fix an ICE in register_tuple_type [PR95523]

When registering the tuple type in register_tuple_type, the
TYPE_ALIGN (tuple_type) will be changed by -fpack-struct=n. We need to
maintain natural alignment in handle_arm_sve_h.

2020-06-10  Haijian Zhang  <z.zhanghaijian@huawei.com>

gcc/
PR target/95523
* config/aarch64/aarch64-sve-builtins.h
(sve_switcher::m_old_maximum_field_alignment): New member.
* config/aarch64/aarch64-sve-builtins.cc
(sve_switcher::sve_switcher): Save maximum_field_alignment in
m_old_maximum_field_alignment and clear maximum_field_alignment.
(sve_switcher::~sve_switcher): Restore maximum_field_alignment.

gcc/testsuite/
PR target/95523
* gcc.target/aarch64/sve/pr95523.c: New test.
gcc/config/aarch64/aarch64-sve-builtins.cc
gcc/config/aarch64/aarch64-sve-builtins.h
gcc/testsuite/gcc.target/aarch64/sve/pr95523.c [new file with mode: 0644]