RISC-V: Don't drop multilibs matching the default march/mabi
Ensures RISC-V multilibs with matching march/mabi but different mcmodel options are preserved.
This commit modifies the RISC-V multilib parsing logic to ensure that multilib entries are not prematurely dropped if they match the default march and mabi but differ in other options like mcmodel. Previously, these entries were discarded, potentially leading to incorrect library selection. The change in riscv_multi_lib_info_t::parse now retains these multilibs for proper consideration.
In Details
In gcc/common/config/riscv/riscv-common.cc, the riscv_multi_lib_info_t::parse method previously contained an early-out condition that would discard multilib configurations if their march and mabi strings exactly matched the target's defaults. This patch removes that early-out, ensuring that multilibs differing only in mcmodel or other less common options are retained and properly enumerated by the multilib infrastructure.
- multilib
- A system used by GCC to support multiple target configurations (e.g., different instruction sets, ABIs) within a single compiler installation. It allows building code for various target variants without needing separate compiler builds.
- march
- A GCC target flag for RISC-V that specifies the base architecture and extensions to enable (e.g., 'rv64', 'rv64imafdc').
- mabi
- A GCC target flag for RISC-V that specifies the Application Binary Interface (ABI) to use (e.g., 'lp64d').
- mcmodel
- A GCC target flag for RISC-V that specifies the memory model, affecting code generation for addressing (e.g., 'medany', 'small').