diff options
author | Jeff Law <jlaw@ventanamicro.com> | 2023-08-07 14:34:40 -0600 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2023-08-07 14:34:40 -0600 |
commit | 18c453f0e633abb9b317947b011ec6e07780fba8 (patch) | |
tree | ffd39e3f9cbbcb97188ace3bd4c99e3ccf2adb5a | |
parent | adfc236c6294d339d30222178160fdea55ab2e87 (diff) | |
download | gcc-18c453f0e633abb9b317947b011ec6e07780fba8.zip gcc-18c453f0e633abb9b317947b011ec6e07780fba8.tar.gz gcc-18c453f0e633abb9b317947b011ec6e07780fba8.tar.bz2 |
[committed][RISC-V]Don't reject constants in cmov condition
This test is too aggressive. Constants have VOIDmode, so we need to let the
through this phase of conditional move support.
Fixes several missed conditional moves with the trunk.
gcc/
* config/riscv/riscv.cc (riscv_expand_conditional_move): Allow
VOIDmode operands to conditional before canonicalization.
-rw-r--r-- | gcc/config/riscv/riscv.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 279304a..5248dd3 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -3582,7 +3582,8 @@ riscv_expand_conditional_move (rtx dest, rtx op, rtx cons, rtx alt) enforce that so that we don't strip away a sign_extension thinking it is unnecessary. We might consider using riscv_extend_operands if they are not already properly extended. */ - if (GET_MODE (op0) != word_mode || GET_MODE (op1) != word_mode) + if ((GET_MODE (op0) != word_mode && GET_MODE (op0) != VOIDmode) + || (GET_MODE (op1) != word_mode && GET_MODE (op1) != VOIDmode)) return false; /* Canonicalize the comparison. It must be an equality comparison |