Landing: bbc5005bf482

Project / Subsystem

gcc / risc-v

Date

2026-08-24

Author

Kito Cheng

Commit

bbc5005bf48212c94501bd3918c44b38be6aa94e

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
risc-v
patch_id
—
commit_hash
bbc5005bf48212c94501bd3918c44b38be6aa94e
source_type
github
headline
RISC-V: Enable -mtune=native and -mcpu=native
tldr
GCC now supports -mtune=native and -mcpu=native for RISC-V, detecting the host CPU.
author
Kito Cheng
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • risc-v
  • • optimization
discussion_id_link
—
bugzilla_pr
—
date
2026-08-24T00:00:00.000Z

GCC’s RISC-V backend now supports -mtune=native and -mcpu=native flags. This allows the compiler to automatically detect the host CPU’s architecture and tuning parameters by inspecting hwprobe or /proc/cpuinfo. The flags behave similarly to other architectures, overriding compiler defaults without affecting explicitly set -march or -mtune values.