Landing: 9ab08d664545
Project / Subsystem
gcc / gcc
Date
2026-06-05
Author
Jakub Jelinek
Commit
9ab08d664545bcea9164040e806385369fdaaf0e
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc
- patch_id
- —
- commit_hash
- 9ab08d664545bcea9164040e806385369fdaaf0e
- source_type
- github
- headline
- C and C++ now support `__builtin_bswapg` and `__builtin_bitreverseg` for generic types
- tldr
- GCC now provides type-generic built-in functions `__builtin_bswapg` and `__builtin_bitreverseg` for byte-swapping and bit-reversal, similar to Clang's offering…
- author
- Jakub Jelinek
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c
- • c++
- • builtins
- • type-generic
- • bit-manipulation
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-06-05T00:00:00.000Z
GCC now introduces __builtin_bswapg and __builtin_bitreverseg, new type-generic built-in functions for byte-swapping and bit-reversal operations, respectively. These built-ins address PR c/122731 and align GCC’s functionality with Clang’s, promoting better cross-compiler compatibility. Unlike other type-generic built-ins, these return the same type as their argument and specifically require unsigned integer or _BitInt types with precision divisible by 8 for __builtin_bswapg.