Landing: da3b0463f663

Project / Subsystem

gcc / tree-optimization

Date

2026-08-31

Author

Kyrylo Tkachov

Commit

da3b0463f66312c9e93a027bae73bf17c24a8833

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
tree-optimization
patch_id
—
commit_hash
da3b0463f66312c9e93a027bae73bf17c24a8833
source_type
github
headline
Canonicalize conditional signed narrow clips to fix RISC-V saturation patterns.
tldr
Canonicalizes conditional signed narrow clips to ensure correct saturation behavior for RISC-V targets.
author
Kyrylo Tkachov
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • risc-v
  • • compiler
discussion_id_link
—
bugzilla_pr
—
date
2026-08-31T00:00:00.000Z

This change canonicalizes conditional signed narrow clip operations before loop if-conversion. The original form could lead to undefined behavior with signed minimum values and was being incorrectly transformed into saturating truncations. The new form ensures that the original overflow semantics are preserved when specific conditions like -fwrapv or sanitization are in effect, restoring correct saturation patterns for RISC-V tests.