Landing: 6becc7cc2c06

Project / Subsystem

gcc / gcc/simplify-rtx

Date

2026-03-31

Author

Bohan Lei

Commit

6becc7cc2c06b3941d829e08100a6ff70cc55262

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/simplify-rtx
patch_id
commit_hash
6becc7cc2c06b3941d829e08100a6ff70cc55262
source_type
github
headline
Simplify RTX comparisons of bitwise operations with constants.
tldr
GCC now simplifies certain comparisons involving bitwise AND/OR operations with constants, potentially fixing an ICE on RISC-V.
author
Bohan Lei
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • risc-v
  • compiler
discussion_id_link
bugzilla_pr
date
2026-03-31T00:00:00.000Z

This patch introduces simplifications for expressions of the form (cmp (and/ior x C1) C2) within GCC’s simplify-rtx pass. By analyzing the relationships between the constants C1 and C2, the compiler can determine cases where the comparison can never be true, allowing for optimization. This change addresses a reported internal compiler error (ICE) on RISC-V and improves code generation in specific scenarios.