On 11/16/26 6:02 AM, Kito Cheng wrote:
-mcpu=native becomes -march=<detected ISA> -mtune=<detected core>, so
cc1 never sees -mcpu.  Later patches take per-core settings, such as
errata, from -mcpu, and they would be lost.

Also pass -mcpu=<core> when the driver knows the core.  The detected
-march still wins over the core's default ISA.

gcc/ChangeLog:

        * config/riscv/driver-riscv.cc (host_detect_local_cpu): Handle
        "cpu".
        * config/riscv/riscv.h (RISCV_NATIVE_SPECS): Pass -mcpu= for
        -mcpu=native.
        * doc/invoke.texi (RISC-V Options): Say that -mcpu=native also
        selects the detected core.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/mcpu-native-1.c: New test.
        * gcc.target/riscv/mcpu-native-1.cpuinfo: New file.
Thanks.  I think this addresses a concern Sashiko flagged with a RISC-V patch, I just don't remember which cone.

Jeff

Reply via email to