riscv: Fix up riscv_rtx_costs for RTL checking (PR target/93333)
commit0b00f43cf381f03aeaced375f8f0ef1e731c9f43
authorJakub Jelinek <jakub@redhat.com>
Fri, 14 Feb 2020 14:41:22 +0000 (14 15:41 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 14 Feb 2020 15:01:47 +0000 (14 16:01 +0100)
tree212aed6f2c00718ad8f5b3e6059353eb211ddfa7
parentf0776f088dce384106609fc868061defd472bc10
riscv: Fix up riscv_rtx_costs for RTL checking (PR target/93333)

As mentioned in the PR, during combine rtx_costs can be called sometimes
even on RTL that has not been validated yet and so can contain even operands
that aren't valid in any instruction.

2020-01-21  Jakub Jelinek  <jakub@redhat.com>

PR target/93333
* config/riscv/riscv.c (riscv_rtx_costs) <case ZERO_EXTRACT>: Verify
the last two operands are CONST_INT_P before using them as such.

* gcc.c-torture/compile/pr93333.c: New test.
gcc/ChangeLog
gcc/config/riscv/riscv.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr93333.c [new file with mode: 0644]