Landing: 003b6877618a

Project / Subsystem

gcc / match

Date

2026-08-19

Author

Kyrylo Tkachov

Commit

003b6877618ad3e483d10d01198edfa2a58ee50e

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
match
patch_id
—
commit_hash
003b6877618ad3e483d10d01198edfa2a58ee50e
source_type
github
headline
Match: Restricts signed saturating truncation to uniform precision.
tldr
Match pattern for signed saturating truncation now requires uniform precision to prevent internal compiler errors.
author
Kyrylo Tkachov
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • match
  • • optimization
  • • vectorization
  • • bugfix
  • • integer arithmetic
discussion_id_link
—
bugzilla_pr
—
date
2026-08-19T00:00:00.000Z

This commit refines the signed_integer_sat_trunc pattern in GCC’s matcher to require that the precision of the operand and the result of the conversion are uniform. Previously, cases where the comparison narrowed the precision after a variable shift could lead to an internal compiler error in the vectorizer. The updated pattern ensures that the conversion maintains the precision of the operand and that the result is narrower, preventing mismatches and resolving PR126982.