Landing: 365e5618bc6f

Project / Subsystem

gcc / gcc/match

Date

2026-05-24

Author

Raven Hallsby

Commit

365e5618bc6fcb62560450677e0fe4f5ba96345e

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc/match
patch_id
commit_hash
365e5618bc6fcb62560450677e0fe4f5ba96345e
source_type
github
headline
Optimize `(~y & x) ^ y` into `(y | x)`
tldr
GCC now optimizes the expression `(~y & x) ^ y` into `(y | x)` to simplify code.
author
Raven Hallsby
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • pattern matching
  • code simplification
discussion_id_link
bugzilla_pr
date
2026-05-24T00:00:00.000Z

GCC’s pattern matching now transforms the expression (~y & x) ^ y into its simpler equivalent (y | x). This optimization was needed because the front-end performs constant optimizations like ~1 -> -2 before the existing similar rule could be applied.