From: Jin Ma Date: Thu, 2 Feb 2023 11:46:04 +0000 (+0800) Subject: RISC-V: Fix bug of TARGET_COMPUTE_MULTILIB implemented in riscv. X-Git-Tag: basepoints/gcc-14~1554 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a02aacf55a35876ddc1e534778dc37fae29054f6;p=thirdparty%2Fgcc.git RISC-V: Fix bug of TARGET_COMPUTE_MULTILIB implemented in riscv. MAX_MATCH_SCORE is not assigned anywhere except initialized to 0, causing BEST_MATCH_MULTI_LIB to always be 0 or -1, which will cause the result of TARGET_COMPUTE_MULTILIB hook to fail. gcc/ChangeLog: * common/config/riscv/riscv-common.cc (riscv_compute_multilib): Fix finding best match score. --- diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index 616e2f897b9d..787674003cb3 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -1700,7 +1700,10 @@ riscv_compute_multilib ( /* Record highest match score multi-lib setting. */ if (match_score > max_match_score) - best_match_multi_lib = i; + { + best_match_multi_lib = i; + max_match_score = match_score; + } } if (best_match_multi_lib == -1)