Landing: 67bc28c6c0c6

Project / Subsystem

gcc / gcc

Date

2026-04-25

Author

Martin Uecker

Commit

67bc28c6c0c68a22280fd0942df598f20e339431

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
67bc28c6c0c68a22280fd0942df598f20e339431
source_type
github
headline
c: Fix use of variably-modified structure/union types in nested context
tldr
Nested functions now correctly handle variably-modified structure/union types that depend on the enclosing context.
author
Martin Uecker
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c
  • nested functions
  • variably-modified types
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-04-25T00:00:00.000Z

The compiler now correctly handles variably-modified structure and union types within nested functions when those types depend on the enclosing function’s context. The TYPE_STUB_DECLs are now marked as used, ensuring that the static chain is correctly established for accessing variables in the enclosing scope. This fixes a bug where nested functions would fail to access variably-modified types correctly, potentially leading to incorrect code generation or runtime errors.