aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJu-Zhe Zhong <juzhe.zhong@rivai.ai>2023-01-18 11:09:21 +0800
committerKito Cheng <kito.cheng@sifive.com>2023-01-27 18:08:58 +0800
commit9b9a1ac14cdca6eef8dbcab0d33f3c03774a6c77 (patch)
treeb95cb0973f84f3b20b9dbd124662a9c9f4bf5a10
parente577b91bbaa7075655de4da4b8af95216d8b1f6d (diff)
downloadgcc-9b9a1ac14cdca6eef8dbcab0d33f3c03774a6c77.zip
gcc-9b9a1ac14cdca6eef8dbcab0d33f3c03774a6c77.tar.gz
gcc-9b9a1ac14cdca6eef8dbcab0d33f3c03774a6c77.tar.bz2
RISC-V: Fix bug of before_p function
compare_with will return other than -1, so it should check less than 0 rather than check exactly with -1. gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (before_p): Fix bug.
-rw-r--r--gcc/config/riscv/riscv-vsetvl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index 45e14d0..a18ccd7 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -187,7 +187,7 @@ real_insn_and_same_bb_p (const insn_info *insn, const bb_info *bb)
static bool
before_p (const insn_info *insn1, const insn_info *insn2)
{
- return insn1->compare_with (insn2) == -1;
+ return insn1->compare_with (insn2) < 0;
}
static bool