MIPSr6 removes condition trap instructions with imm, so the instruction
like `teq $2,imm` will be converted to
li $at, imm
teq $2, $at
The current version of Gas cannot detect if imm is zero, and output
teq $2, $0
Let's do it in GCC.
gcc
* config/mips/mips.md(conditional_trap_reg): Output $0 instead
of 0 if !ISA_HAS_COND_TRAPI.
(match_operand:GPR 2 "reg_or_0_operand" "dJ")])
(const_int 0))]
"ISA_HAS_COND_TRAP && !ISA_HAS_COND_TRAPI"
- "t%C0\t%z1,%2"
+ "t%C0\t%z1,%z2"
[(set_attr "type" "trap")])
(define_insn "*conditional_trap<mode>"