Landing: 67dfeda64835

Project / Subsystem

gcc / match.pd

Date

2026-08-24

Author

Kyrylo Tkachov

Commit

67dfeda6483525262abbd26a0789672dfa9a0a33

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
match.pd
patch_id
—
commit_hash
67dfeda6483525262abbd26a0789672dfa9a0a33
source_type
github
headline
Prevent reduction simplification cycle in match.pd
tldr
Fixes a compiler infinite loop caused by reduction simplification rules.
author
Kyrylo Tkachov
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • tree-optimization
  • • vector
  • • bugfix
discussion_id_link
—
bugzilla_pr
—
date
2026-08-24T00:00:00.000Z

A cycle in the reduction simplification rules within match.pd could cause the compiler to enter an infinite loop, exhausting memory. This issue occurred when transformation rules for reductions, particularly those involving constants and scalable vectors, repeatedly applied and undid each other. The fix separates reduction rules with inverse pairs from those without, ensuring that constant reductions only apply when they simplify to a scalar, thus breaking the cycle.