[PATCH] RISC-V: Fix bug of before_p function

Kito Cheng kito.cheng@gmail.com
Fri Jan 27 10:09:05 GMT 2023


Committed with more comments to describe why this should be fixed.

On Wed, Jan 18, 2023 at 11:10 AM <juzhe.zhong@rivai.ai> wrote:

> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
>
> 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 26d096ea939..728a32dacd6 100644
> --- a/gcc/config/riscv/riscv-vsetvl.cc
> +++ b/gcc/config/riscv/riscv-vsetvl.cc
> @@ -188,7 +188,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
> --
> 2.36.3
>
>


More information about the Gcc-patches mailing list