Landing: 7decbb57670c

Project / Subsystem

gcc / gcc/match

Date

2026-07-30

Author

Reshma Roy

Commit

7decbb57670c3c0f6136be00456fe9c8a41f7aed

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc/match
patch_id
—
commit_hash
7decbb57670c3c0f6136be00456fe9c8a41f7aed
source_type
github
headline
Fixes incorrect POPCOUNT pattern identification.
tldr
Corrects a pattern matcher to accurately identify the POPCOUNT intrinsic, preventing incorrect optimizations.
author
Reshma Roy
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • pattern matching
  • • intrinsics
discussion_id_link
—
bugzilla_pr
—
date
2026-07-30T00:00:00.000Z

This commit corrects a bug in GCC’s pattern matching for the POPCOUNT intrinsic. A previously introduced 32-bit matcher incorrectly identified patterns, accepting any mask due to a flawed predicate. The fix ensures that only the intended Hacker’s Delight popcount idiom is folded into the IFN_POPCOUNT intrinsic by adding a necessary constant check.