RISC-V: Handle extensions combination correctly in multilib-generator.
authorKito Cheng <kito.cheng@sifive.com>
Tue, 6 Aug 2019 03:16:40 +0000 (03:16 +0000)
committerKito Cheng <kito@gcc.gnu.org>
Tue, 6 Aug 2019 03:16:40 +0000 (03:16 +0000)
commit7551a6e467c64b3155d5b8f005cd7ea7143b21f3
treeec027587fbbaeeab5c1cdfa487be2f7580080228
parentc026e33449102076609e084ca2cd4a729b3c504b
RISC-V: Handle extensions combination correctly in multilib-generator.

Input string consist of four parts:
  <primary arch>-<abi>-<additional arches>-<extensions>

and generator doing combination with <extensions> part, but it just
append the extension at the end of arch string, it might generate
invalid arch.

For example, without this patch `./multilib-generator rv32imafc-ilp32--d`
will generate:

MULTILIB_OPTIONS = march=rv32imafc/march=rv32imafcd mabi=ilp32
                                         ^^^^^^^^^^

and rv32imafcd is not in canonical order.

Tested with python 2.7 and python 3.6/3.7.

gcc/ChangeLog

* gcc/config/riscv/multilib-generator: (canonical_order): New.
(arch_canonicalize): Dito.
Apply arch_canonicalize for alts.

From-SVN: r274137
gcc/ChangeLog
gcc/config/riscv/multilib-generator