]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Move mode assertion out of conditional branch in emit_insn
authorEdwin Lu <ewlu@rivosinc.com>
Fri, 14 Jun 2024 16:46:01 +0000 (09:46 -0700)
committerEdwin Lu <ewlu@rivosinc.com>
Tue, 18 Jun 2024 22:28:17 +0000 (15:28 -0700)
commitffe5141f30655e1889c8d0471a4f60fa4d64d1b0
tree276c295b52334a40cdbc4b00dc19818dbca6fa5e
parent6638ba17eadc0f450faa3d8c2f77afe7fdb20614
RISC-V: Move mode assertion out of conditional branch in emit_insn

When emitting insns, we have an early assertion to ensure the input
operand's mode and the expanded operand's mode are the same; however, it
does not perform this check if the pattern does not have an explicit
machine mode specifying the operand. In this scenario, it will always
assume that mode = Pmode to correctly satisfy the
maybe_legitimize_operand check, however, there may be problems when
working in 32 bit environments.

Make the assert unconditional and replace it with an internal error for
more descriptive logging

gcc/ChangeLog:

* config/riscv/riscv-v.cc: Move assert out of conditional block

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
Co-authored-by: Robin Dapp <rdapp@ventanamicro.com>
gcc/config/riscv/riscv-v.cc