From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2093) id 24AAC386F82B; Thu, 26 May 2022 06:10:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24AAC386F82B 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-8417] 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-12 X-Git-Oldrev: 02e8dea4944f9995ed3623dc15c2ad73e0376f27 X-Git-Newrev: f1e47f34abafa9f943dd5dbe4375b0d849a1a0ac Message-Id: <20220526061038.24AAC386F82B@sourceware.org> Date: Thu, 26 May 2022 06:10:38 +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:38 -0000 https://gcc.gnu.org/g:f1e47f34abafa9f943dd5dbe4375b0d849a1a0ac commit r12-8417-gf1e47f34abafa9f943dd5dbe4375b0d849a1a0ac 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 41bab69193c..8b66687cc44 100755 --- a/gcc/config/riscv/arch-canonicalize +++ b/gcc/config/riscv/arch-canonicalize @@ -73,8 +73,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: