Landing: e2c4fc6b1cff

Project / Subsystem

gcc / gcc/match

Date

2026-07-09

Author

Eikansh Gupta

Commit

e2c4fc6b1cff0d32dd7e6e4049d87c5193fea6dc

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/match
patch_id
commit_hash
e2c4fc6b1cff0d32dd7e6e4049d87c5193fea6dc
source_type
github
headline
Simplify copysign pattern for constants
tldr
GCC match.pd simplifies copysign with constant arguments to use a simplified form.
author
Eikansh Gupta
outcome
committed
performance_win
true
breaking_change
false
series_id
gcc:match: simplify `(trunc)copysign ((extend)x, cst)` to `copysign (x, -1..0)` [pr112472]
series_parts
[]
tags
  • gcc
  • optimization
  • pattern matching
discussion_id_link
bugzilla_pr
date
2026-07-09T00:00:00.000Z

GCC’s pattern matching (match.pd) is updated to simplify copysign operations where one argument is a constant. The pattern (trunc)copysign ((extend)x, CST) can now be reduced to copysign (x, -1.0/1.0), depending on the sign of the constant. This change is accompanied by a new test case for validation.