Landing: ad6087410356

Project / Subsystem

gcc / gcc/match

Date

2026-07-04

Author

Andrew Pinski

Commit

ad6087410356999730cbe9680ada3077f4afcf76

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc/match
patch_id
commit_hash
ad6087410356999730cbe9680ada3077f4afcf76
source_type
github
headline
Fix match pattern for `((a ^ b) & c) cmp d || a != b`
tldr
Improved pattern matching for logical operations to correctly handle non-short-circuiting evaluation.
author
Andrew Pinski
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • pattern matching
  • gcc
  • tree-ssa
discussion_id_link
bugzilla_pr
date
2026-07-04T00:00:00.000Z

This commit refactors a pattern matching rule in GCC’s match.pd to correctly handle logical operations when short-circuiting is disabled. It specifically addresses the ((a ^ b) & c) cmp d || a != b construct by adding support for the && (AND) case, which simplifies to !(((a ^ b) & c) cmp d || a != b), and also fixes operand constraints.