From: Wilco Dijkstra Date: Wed, 28 Jun 2017 14:21:04 +0000 (+0000) Subject: This patch fixes a failure in gcc.target/aarch64/reload-valid-spoff.c triggered... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00eee3fa2a884e3ab0bcbf6de3a94d4da2b34d4c;p=gcc.git This patch fixes a failure in gcc.target/aarch64/reload-valid-spoff.c triggered... This patch fixes a failure in gcc.target/aarch64/reload-valid-spoff.c triggered by https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01367.html. In ILP32 all memory accesses must have Pmode as the base address, but aarch64_expand_mov_immediate wasn't emitting a conversion in one case. Besides fixing this add an assert that flags any MEM operands that are not Pmode. gcc/ * config/aarch64/aarch64 (aarch64_expand_mov_immediate): Convert memory address to Pmode. (aarch64_print_operand): Assert MEM operands are always Pmode. From-SVN: r249741 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0ed9bfc8580..293671b8ff2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-06-28 Wilco Dijkstra + + * config/aarch64/aarch64 (aarch64_expand_mov_immediate): + Convert memory address to Pmode. + (aarch64_print_operand): Assert MEM operands are always Pmode. + 2017-06-28 Wilco Dijkstra PR target/79665 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 6bff74c86a6..593263ff9b2 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -2002,6 +2002,8 @@ aarch64_expand_mov_immediate (rtx dest, rtx imm) gcc_assert (can_create_pseudo_p ()); base = gen_reg_rtx (ptr_mode); aarch64_expand_mov_immediate (base, XEXP (mem, 0)); + if (ptr_mode != Pmode) + base = convert_memory_address (Pmode, base); mem = gen_rtx_MEM (ptr_mode, base); } @@ -5265,6 +5267,8 @@ aarch64_print_operand (FILE *f, rtx x, int code) case MEM: output_address (GET_MODE (x), XEXP (x, 0)); + /* Check all memory references are Pmode - even with ILP32. */ + gcc_assert (GET_MODE (XEXP (x, 0)) == Pmode); break; case CONST: