From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2093) id 84FA53858412; Thu, 2 Feb 2023 13:32:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84FA53858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675344753; bh=v95lb8FTsKutrvVVq7Z2cM9VRClqM68jzfYMz03OY9M=; h=From:To:Subject:Date:From; b=ueA33SeJSjU/bo0geYMu6pmR1Jgj4Er9F82uD8PkNxG/o6vfztUIgAfBlhNMxqpco 0054YeH7dK5bMs35CaRJMe+s2ye9wL1T/0oBbQ6d2NJf57VUYkKdB9NsWVeTmvGlxF UOkkI2dGaKnWvxALWY2Ce4Obt0VBL9ZStnhocZMQ= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Kito Cheng To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5653] RISC-V: Fix bug of TARGET_COMPUTE_MULTILIB implemented in riscv. X-Act-Checkin: gcc X-Git-Author: Jin Ma X-Git-Refname: refs/heads/master X-Git-Oldrev: 465a9c51e7d5bafa7a81195b5af20f2a54f22210 X-Git-Newrev: a02aacf55a35876ddc1e534778dc37fae29054f6 Message-Id: <20230202133233.84FA53858412@sourceware.org> Date: Thu, 2 Feb 2023 13:32:33 +0000 (GMT) List-Id: https://gcc.gnu.org/g:a02aacf55a35876ddc1e534778dc37fae29054f6 commit r13-5653-ga02aacf55a35876ddc1e534778dc37fae29054f6 Author: Jin Ma Date: Thu Feb 2 19:46:04 2023 +0800 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: --- gcc/common/config/riscv/riscv-common.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index 616e2f897b9..787674003cb 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)