Hi all, I'd like to back-port this to the gcc-9 branch. This patch is directly based on:
https://gcc.gnu.org/pipermail/gcc-patches/2020-April/543627.html https://gcc.gnu.org/pipermail/gcc-patches/2020-April/543901.html Bootstrapped and reg tested. Ok for release/gcc-9? Bests Andrea gcc/ChangeLog 2020-??-?? Andrea Corallo <andrea.cora...@arm.com> * config/aarch64/falkor-tag-collision-avoidance.c (valid_src_p): Check for aarch64_address_info type before accessing base field. gcc/testsuite/ChangeLog 2020-??-?? Andrea Corallo <andrea.cora...@arm.com> * gcc.target/aarch64/pr94530.c: New test.
>From 1e70131c2c099c1071baba3f40d610f41ff4e9ea Mon Sep 17 00:00:00 2001 From: Andrea Corallo <andrea.cora...@arm.com> Date: Tue, 14 Apr 2020 19:51:54 +0100 Subject: [PATCH] pr94530 gcc-9 --- gcc/config/aarch64/falkor-tag-collision-avoidance.c | 7 +++++++ gcc/testsuite/gcc.target/aarch64/pr94530.c | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/pr94530.c diff --git a/gcc/config/aarch64/falkor-tag-collision-avoidance.c b/gcc/config/aarch64/falkor-tag-collision-avoidance.c index 779dee81f7f4..698d1595d0a6 100644 --- a/gcc/config/aarch64/falkor-tag-collision-avoidance.c +++ b/gcc/config/aarch64/falkor-tag-collision-avoidance.c @@ -537,6 +537,13 @@ valid_src_p (rtx src, rtx_insn *insn, struct loop *loop, bool *pre_post, if (!aarch64_classify_address (&addr, XEXP (x, 0), mode, true)) return false; + if (addr.type != ADDRESS_REG_IMM + && addr.type != ADDRESS_REG_WB + && addr.type != ADDRESS_REG_REG + && addr.type != ADDRESS_REG_UXTW + && addr.type != ADDRESS_REG_SXTW) + return false; + unsigned regno = REGNO (addr.base); if (global_regs[regno] || fixed_regs[regno]) return false; diff --git a/gcc/testsuite/gcc.target/aarch64/pr94530.c b/gcc/testsuite/gcc.target/aarch64/pr94530.c new file mode 100644 index 000000000000..1f98201c50a8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr94530.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -mcpu=falkor -mpc-relative-literal-loads -mcmodel=large" } */ + +extern void bar(const char *); + +void foo(void) { + for (;;) + bar(""); +} -- 2.17.1