[AArch64] Fix ICEs in aarch64_print_operand
commitdde65a3fbd40e961844b50b43cbe7ddf01bd3c33
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Dec 2017 18:43:40 +0000 (7 18:43 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Dec 2017 18:43:40 +0000 (7 18:43 +0000)
tree92bd80b3ea4488a4ef1d0b49290f617f3f264c06
parent0a2b1323a4d46d85c75d73778a7a78b42d750919
[AArch64] Fix ICEs in aarch64_print_operand

Three related regression fixes:

- We can't use asserts like:

    gcc_assert (GET_MODE_SIZE (mode) == 16);

  in aarch64_print_operand because it could trigger for invalid user input.

- The output_operand_lossage in aarch64_print_address_internal:

    output_operand_lossage ("invalid operand for '%%%c'", op);

  wasn't right because "op" is an rtx_code enum rather than the
  prefix character.

- aarch64_print_operand_address shouldn't call output_operand_lossage
  (because it doesn't have a prefix code) but instead fall back to
  output_addr_const.

2017-12-05  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* config/aarch64/aarch64.c (aarch64_print_address_internal): Return
a bool success value.  Don't call output_operand_lossage here.
(aarch64_print_ldpstp_address): Return a bool success value.
(aarch64_print_operand_address): Call output_addr_const if
aarch64_print_address_internal fails.
(aarch64_print_operand): Don't assert that the mode is 16 bytes for
'y'; call output_operand_lossage instead.  Call output_operand_lossage
if aarch64_print_ldpstp_address fails.

gcc/testsuite/
* gcc.target/aarch64/asm-2.c: New test.
* gcc.target/aarch64/asm-3.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255481 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/asm-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/asm-3.c [new file with mode: 0644]