Landing: 997a8a9bb85b

Project / Subsystem

gcc / gcc

Date

2026-06-05

Author

Jakub Jelinek

Commit

997a8a9bb85b615e9c1ec7fed802e203a6aaa4a3

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
997a8a9bb85b615e9c1ec7fed802e203a6aaa4a3
source_type
github
headline
Store-merging pass considers bswap and fixes RISC-V build
tldr
The store-merging optimization in GCC now correctly handles byte-swap operations and resolves a build failure on RISC-V.
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • risc-v
  • byte-swap
  • internal api
discussion_id_link
bugzilla_pr
date
2026-06-05T00:00:00.000Z

This commit enhances the store-merging optimization pass in GCC to account for widen_bswap_or_bitreverse operations, rather than relying on an expander for 32-bit byte swaps. This change resolves a build issue on the RISC-V architecture where the bswapsi2 expander caused a failure due to an incorrect FAIL condition. Now, the store-merging pass considers __builtin_bswap32 as cheap if a bswapdi2 expander is present, leading to more robust and correct code generation, especially for 64-bit targets.