diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/riscv/thead.md | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/riscv/xtheadcondmov-bug.c | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/config/riscv/thead.md b/gcc/config/riscv/thead.md index 54b9737..d816f3b 100644 --- a/gcc/config/riscv/thead.md +++ b/gcc/config/riscv/thead.md @@ -154,11 +154,11 @@ ;; XTheadCondMov -(define_insn "*th_cond_mov<GPR:mode><GPR2:mode>" +(define_insn "*th_cond_mov<GPR:mode>" [(set (match_operand:GPR 0 "register_operand" "=r,r") (if_then_else:GPR (match_operator 4 "equality_operator" - [(match_operand:GPR2 1 "register_operand" "r,r") + [(match_operand:X 1 "register_operand" "r,r") (const_int 0)]) (match_operand:GPR 2 "reg_or_0_operand" "rJ,0") (match_operand:GPR 3 "reg_or_0_operand" "0,rJ")))] diff --git a/gcc/testsuite/gcc.target/riscv/xtheadcondmov-bug.c b/gcc/testsuite/gcc.target/riscv/xtheadcondmov-bug.c new file mode 100644 index 0000000..01cec62 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/xtheadcondmov-bug.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target { rv64 } } } */ +/* { dg-options "-march=rv64gc_xtheadcondmov -mabi=lp64d -O2" } */ + +long long int +foo (long long int x, long long int y) +{ + if (((int) x | (int) y) != 0) + return 6; + return x + y; +} + +/* { dg-final { scan-assembler-times {\msext\.w\M} 1 } } */ |