Landing: cc58cf0d2f9b
Project / Subsystem
gcc / gcc/optabs
Date
2026-06-06
Author
Richard Sandiford
Commit
cc58cf0d2f9b255e29d9b7a409c5ab31542604d1
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc/optabs
- patch_id
- —
- commit_hash
- cc58cf0d2f9b255e29d9b7a409c5ab31542604d1
- source_type
- github
- headline
- Extend can_open_code_p to handle bswap operations for store merging
- tldr
- GCC now uses `can_open_code_p` to determine if `bswap` operations can be open-coded during store merging, improving scalar optimization and fixing a RISC-V tes…
- author
- Richard Sandiford
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • gimple
- • risc-v
- • code generation
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-06-06T00:00:00.000Z
This commit refactors GCC’s store merging pass to rely on can_open_code_p for determining if bswap (byte swap) operations can be generated as inline code. Previously, this logic was duplicated and less efficient within gimple-ssa-store-merging.cc. By centralizing this check in can_open_code_p and extending it to handle various bswap cases, the compiler can more effectively optimize scalar code and resolve a bug in gcc.dg/optimize-bswapsi-6.c on RISC-V architectures.