From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2093) id E07A238356B3; Thu, 26 May 2022 06:50:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E07A238356B3 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 r11-10035] RISC-V: Don't unconditionally add m, a, f, d in arch-canonicalize X-Act-Checkin: gcc X-Git-Author: Simon Cook X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 778b1362f9038471f4693410345f25f7ba7c8bc8 X-Git-Newrev: 2826e74b307cc471d0dc5349cf967ee1b1328653 Message-Id: <20220526065045.E07A238356B3@sourceware.org> Date: Thu, 26 May 2022 06:50:45 +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:50:46 -0000 https://gcc.gnu.org/g:2826e74b307cc471d0dc5349cf967ee1b1328653 commit r11-10035-g2826e74b307cc471d0dc5349cf967ee1b1328653 Author: Simon Cook Date: Wed May 25 14:25:43 2022 +0100 RISC-V: Don't unconditionally add m,a,f,d in arch-canonicalize This solves an issue where rv32i, etc. are canonicalized to rv32imafd since the g->i addition of 'm', 'a', 'f', 'd' is not actually gated by whether the input was rv32g/rv64g. gcc/ChangeLog: * config/riscv/arch-canonicalize: Only add mafd extension if base was rv32/rv64g. (cherry picked from commit 63f198553d3940495bfaa49da30b2ce93375c916) Diff: --- gcc/config/riscv/arch-canonicalize | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/riscv/arch-canonicalize b/gcc/config/riscv/arch-canonicalize index 980b1d1dcba..0bdf6aafe35 100755 --- a/gcc/config/riscv/arch-canonicalize +++ b/gcc/config/riscv/arch-canonicalize @@ -48,8 +48,8 @@ def arch_canonicalize(arch, isa_spec): std_exts = [] if arch[:5] in ['rv32e', 'rv32i', 'rv32g', 'rv64i', 'rv64g']: new_arch = arch[:5].replace("g", "i") - std_exts = ['m', 'a', 'f', 'd'] if arch[:5] in ['rv32g', 'rv64g']: + std_exts = ['m', 'a', 'f', 'd'] if not is_isa_spec_2p2: extra_long_ext = ['zicsr', 'zifencei'] else: