From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2093) id 05441386F82B; Thu, 26 May 2022 06:10:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05441386F82B 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 r12-8416] RISC-V: Fix wrong expansion for arch-canonicalize X-Act-Checkin: gcc X-Git-Author: Kito Cheng X-Git-Refname: refs/heads/releases/gcc-12 X-Git-Oldrev: 0320f3b120bd5219e6b94ea2911b650848f29a88 X-Git-Newrev: 02e8dea4944f9995ed3623dc15c2ad73e0376f27 Message-Id: <20220526061033.05441386F82B@sourceware.org> Date: Thu, 26 May 2022 06:10:33 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2022 06:10:33 -0000 https://gcc.gnu.org/g:02e8dea4944f9995ed3623dc15c2ad73e0376f27 commit r12-8416-g02e8dea4944f9995ed3623dc15c2ad73e0376f27 Author: Kito Cheng Date: Mon May 9 11:44:30 2022 +0800 RISC-V: Fix wrong expansion for arch-canonicalize rv64gcv should exapnd into: rv64imafdcv_zicsr_zifencei_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b but we exapnd fd twice for now: rv64imafdfdcv_zicsr_zifencei_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b gcc/ChangeLog: * config/riscv/arch-canonicalize: Handle g correctly. (cherry picked from commit 27239e13b1ba383e2706231917062aa6e14150a8) Diff: --- gcc/config/riscv/arch-canonicalize | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gcc/config/riscv/arch-canonicalize b/gcc/config/riscv/arch-canonicalize index f36a2ca4593..41bab69193c 100755 --- a/gcc/config/riscv/arch-canonicalize +++ b/gcc/config/riscv/arch-canonicalize @@ -70,8 +70,10 @@ def arch_canonicalize(arch, isa_spec): is_isa_spec_2p2 = isa_spec == '2.2' new_arch = "" extra_long_ext = [] + std_exts = [] if arch[:5] in ['rv32e', 'rv32i', 'rv32g', 'rv64i', 'rv64g']: - new_arch = arch[:5].replace("g", "imafd") + new_arch = arch[:5].replace("g", "i") + std_exts = ['m', 'a', 'f', 'd'] if arch[:5] in ['rv32g', 'rv64g']: if not is_isa_spec_2p2: extra_long_ext = ['zicsr', 'zifencei'] @@ -86,10 +88,10 @@ def arch_canonicalize(arch, isa_spec): if long_ext_prefixes_idx: first_long_ext_idx = min(long_ext_prefixes_idx) long_exts = arch[first_long_ext_idx:].split("_") - std_exts = list(arch[5:first_long_ext_idx]) + std_exts += list(arch[5:first_long_ext_idx]) else: long_exts = [] - std_exts = list(arch[5:]) + std_exts += list(arch[5:]) long_exts += extra_long_ext