On 8/28/23 21:39, Tsukasa OI wrote:
From: Tsukasa OI <research_tra...@irq.a4lg.com>

After commit c283c4774d1c ("RISC-V: Throw compilation error for unknown
extensions") changed how do we handle unknown extensions, we have no
guarantee that we can share the same architectural string with Binutils
(specifically, the assembler).

To avoid compilation errors on shared Assembler-C/C++ projects or programs
with inline assembler, GCC should support almost all extensions that
Binutils support, even if the GCC itself does not touch a thing.

As a start, this commit adds stub supported *privileged* extensions to
riscv_ext_version_table and its implications to riscv_implied_info
(all information is copied from Binutils' bfd/elfxx-riscv.c).

gcc/ChangeLog:

        * common/config/riscv/riscv-common.cc
        (riscv_implied_info): Add implications from privileged extensions.
        (riscv_ext_version_table): Add stub support for all privileged
        extensions supported by Binutils.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/predef-29.c: New test for a stub privileged
        extension 'Smstateen' with some implications.
OK
jeff

Reply via email to