From 9b9a1ac14cdca6eef8dbcab0d33f3c03774a6c77 Mon Sep 17 00:00:00 2001 From: Ju-Zhe Zhong Date: Wed, 18 Jan 2023 11:09:21 +0800 Subject: [PATCH] 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. --- gcc/config/riscv/riscv-vsetvl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index 45e14d0ff03..a18ccd72ab6 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