Landing: 9a54dbee11c8
Project / Subsystem
gcc / gcc/range-op
Date
2026-08-12
Author
Daniel Barboza
Commit
9a54dbee11c890546b0bad8e3022296f02449181
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc/range-op
- patch_id
- —
- commit_hash
- 9a54dbee11c890546b0bad8e3022296f02449181
- source_type
- github
- headline
- Infer non-zero result for bitwise OR when operands are known to be different.
- tldr
- Compiler now deduces `A | B` is non-zero if `A` is not equal to `B`.
- author
- Daniel Barboza
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • range analysis
- • bitwise operations
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-08-12T00:00:00.000Z
This commit enhances the range analysis optimization pass by introducing a new relation effect for the bitwise OR operation (bit_ior). When the compiler can determine that the two operands of a bitwise OR are not equal (A != B), it can now infer that the result of A | B will always be non-zero. This allows for more aggressive optimizations in subsequent passes by providing tighter range information.