]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Don't unconditionally add m,a,f,d in arch-canonicalize
authorSimon Cook <simon.cook@embecosm.com>
Wed, 25 May 2022 13:25:43 +0000 (14:25 +0100)
committerKito Cheng <kito.cheng@sifive.com>
Wed, 25 May 2022 14:00:17 +0000 (22:00 +0800)
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.

gcc/config/riscv/arch-canonicalize

index 71b2232b29e37139d39fe7c5d64c36671ffe48c6..fd7651ac4915134bd117ad9e72b1a02cf6a70cf5 100755 (executable)
@@ -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: