Landing: d8164f4da406

Project / Subsystem

gcc / gcc/match

Date

2026-10-02

Author

Andrea Pinski

Commit

d8164f4da406c5061075472961b3c448604eb686

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc/match
patch_id
—
commit_hash
d8164f4da406c5061075472961b3c448604eb686
source_type
github
headline
Fix integer overflow pattern for abs((convert)a)
tldr
Corrected a GCC pattern for abs((convert)a) to prevent integer overflow and undefined behavior.
author
Andrea Pinski
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • integer overflow
  • • pattern matching
  • • undefined behavior
discussion_id_link
—
bugzilla_pr
—
date
2026-10-02T00:00:00.000Z

A pattern in GCC’s pattern matching for (trunc)abs((ext)a) was fixed to prevent potential integer overflow and undefined behavior. The pattern has been restricted to non-integral types, ensuring that integer types are handled by a separate, more appropriate pattern. This resolves a bug where casting from unsigned types could lead to incorrect results.