From: Ju-Zhe Zhong Date: Wed, 18 Jan 2023 03:09:21 +0000 (+0800) Subject: RISC-V: Fix bug of before_p function X-Git-Tag: basepoints/gcc-14~1772 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b9a1ac14cdca6eef8dbcab0d33f3c03774a6c77;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index 45e14d0ff035..a18ccd72ab62 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