Hi The testcase pr78255.c triggers ice when testing GCC trunk on aarch64 with -mabi=ilp32 -fPIC. Case path: gcc/testsuite/gcc.target/aarch64/pr78255.c
The ICE is caused by insufficient support for the tiny code model under ilp32 mode with fPIC option, where a SI mode register might be used for the ldr instruction. However, current md pattern for UNSPEC_GOTTINYPIC only support DI mode register as its operator. A simple solution is to add the pattern in tiny code model to support ilp32 mode. Attached please find the proposed patch. Newly add test fail without the patch and pass after applying the patch. Bootstrap and tested on aarch64 Linux platform. No new regression witnessed. Any suggestion? Thanks, Duan bo Log: gcc: +2020-03-16 Duan bo <duan...@huawei.com> + + PR c/94201 + * config/aarch64/aarch64.md (ldr_got_tiny_<mode>): New pattern. + (ldr_got_tiny_sidi): Likewise. + * config/aarch64/aarch64.c: new pattern added to support ilp32 in tiny code model. gcc/testsuite: +2020-03-16 Duan bo <duan...@huawei.com> + + PR c/94201 + * gcc.target/aarch64/pr94201.c:New test.
pr94201-v0.patch
Description: pr94201-v0.patch