RISC-V: Preserve arch version info during normalizing arch string
authorKito Cheng <kito.cheng@sifive.com>
Mon, 29 Jun 2020 09:52:42 +0000 (17:52 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Wed, 1 Jul 2020 03:30:02 +0000 (11:30 +0800)
commit83c25f27c442ce567829491fc1b4703f51b9bea6
tree7ace8528c181b393ffb4e9d8650af938e25bb804
parenta2cc9b454d7ce04b8209cd22d661da7f9327ae80
RISC-V: Preserve arch version info during normalizing arch string

- Arch version should preserved if user explicitly specified the version.
  e.g.
    After normalize, -march=rv32if3d should be -march=rv32i_f3p0d
    instead of-march=rv32ifd.

gcc/ChangeLog:

* common/config/riscv/riscv-common.c (riscv_subset_t): New field
added.
(riscv_subset_list::parsing_subset_version): Add parameter for
indicate explicitly version, and handle explicitly version.
(riscv_subset_list::handle_implied_ext): Ditto.
(riscv_subset_list::add): Ditto.
(riscv_subset_t::riscv_subset_t): Init new field.
(riscv_subset_list::to_string): Always output version info if version
explicitly specified.
(riscv_subset_list::parsing_subset_version): Handle explicitly
arch version.
(riscv_subset_list::parse_std_ext): Ditto.
(riscv_subset_list::parse_multiletter_ext): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/attribute-13.c: New.
gcc/common/config/riscv/riscv-common.c
gcc/testsuite/gcc.target/riscv/attribute-13.c [new file with mode: 0644]