[AArch64] Fix ICEs in aarch64_print_operand
authorRichard Sandiford <richard.sandiford@linaro.org>
Thu, 7 Dec 2017 18:43:40 +0000 (18:43 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 7 Dec 2017 18:43:40 +0000 (18:43 +0000)
commitc348cab062adf3946fdadff884b7f43774d72d8f
tree92bd80b3ea4488a4ef1d0b49290f617f3f264c06
parent63570af0b58a3c354723bc78b75d76dbb0750f47
[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.

From-SVN: r255481
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]