Landing: 44c5f9a37aa3

Project / Subsystem

gcc / match

Date

2026-05-25

Author

Andrew Pinski

Commit

44c5f9a37aa3dffac654c743147021df917daab0

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
match
patch_id
commit_hash
44c5f9a37aa3dffac654c743147021df917daab0
source_type
github
headline
Match: Reject non-integral types in `(smaller)a ==/!= (smaller) b` pattern.
tldr
The compiler avoids generating invalid GIMPLE when comparing pointers cast to smaller integer types.
author
Andrew Pinski
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • gimple
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-05-25T00:00:00.000Z

The compiler’s pattern matching logic now rejects attempts to compare pointers cast to smaller integer types using equality or inequality operators. Previously, this could lead to invalid GIMPLE (the compiler’s intermediate representation) due to the unexpected operation of ptr ^ ptr. This fix avoids an invalid operation and ensures proper code generation.