Landing: 913ff90691db
Project / Subsystem
gcc / risc-v
Date
2026-07-18
Author
wangjue
Commit
913ff90691dbd1a94bb5b205415955dd053279dd
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- risc-v
- patch_id
- —
- commit_hash
- 913ff90691dbd1a94bb5b205415955dd053279dd
- source_type
- github
- headline
- Prevent size-growing complete loop unrolling at -O2.
- tldr
- RISC-V now avoids aggressive complete loop unrolling at -O2 unless explicitly requested.
- author
- wangjue
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • risc-v
- • optimization
- • loop unrolling
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-18T00:00:00.000Z
This commit modifies the RISC-V backend’s default optimization behavior. While -O2 typically enables small-loop unrolling, this change prevents ‘complete unrolling’ that could lead to code size increases, unless the user explicitly requests it via flags. This aims to strike a better balance between performance and code size for typical -O2 compilations on RISC-V.