Landing: 1f4cc0f7a14b

Project / Subsystem

gcc / match.pd

Date

2026-07-30

Author

Jakub Jelinek

Commit

1f4cc0f7a14b52fdfbd02ac890cc7aedbdfb1979

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
match.pd
patch_id
—
commit_hash
1f4cc0f7a14b52fdfbd02ac890cc7aedbdfb1979
source_type
github
headline
match.pd: Correct parity(~x) simplification for odd bit-widths.
tldr
Fixes incorrect parity calculation for bitwise NOT on odd-width integers.
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • bugfix
  • • bit-manipulation
discussion_id_link
—
bugzilla_pr
—
date
2026-07-30T00:00:00.000Z

A simplification rule in match.pd incorrectly assumed that parity(~X) is always equivalent to parity(X). This commit corrects that rule, noting that for integer types with an odd number of bits, parity(~X) is actually equivalent to parity(X) ^ 1. This ensures accurate parity calculations for bitwise NOT operations on types with odd precision, fixing PR126471.