Landing: 08490fa0ba99

Project / Subsystem

gcc / gcc

Date

2026-04-07

Author

Heiko Eißfeldt

Commit

08490fa0ba99788d9bc945d0dc81fdf832b67a70

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
08490fa0ba99788d9bc945d0dc81fdf832b67a70
source_type
github
headline
Fixes ICE with -Winfinite-recursion by using iteration instead of recursion.
tldr
Avoids stack overflows when using -Winfinite-recursion on very large functions by switching to an iterative approach.
author
Heiko Eißfeldt
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • gcc
  • warning
  • recursion
  • stack overflow
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-04-07T00:00:00.000Z

The implementation of -Winfinite-recursion used a recursive algorithm to detect infinite recursion, which could lead to stack overflows when processing very large functions. This commit replaces the recursive calls with an iterative approach, avoiding stack exhaustion. The underlying logic for detecting infinite recursion remains unchanged.