GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/c

Fix ICE on pointer to VLA of a tagged type

Removes an incorrect type check that caused internal compiler errors with VLAs of tagged types.

This commit corrects an internal compiler error (ICE) related to Variable Length Arrays (VLAs) of tagged types. The check for complete types in top_array_vla_p was found to be incorrect and has been removed. This resolves issues where the compiler encountered arrays with incomplete element types, particularly when structures or unions were replaced with their incomplete versions during canonical type construction.

In Details

Removes an incorrect check in top_array_vla_p within c-typeck.cc. The check complete_type_p was too strict and could lead to an ICE when dealing with VLAs whose element types might be incomplete (e.g., when canonicalizing types by replacing structs/unions with their incomplete counterparts). The fix ensures that such cases are handled correctly without triggering an ICE.

For Context
ICE
Internal Compiler Error. A condition where the compiler encounters an unexpected internal state, leading to a crash rather than a compilation error. These are typically bugs within the compiler itself.
VLA
Variable Length Array. An array whose size is determined at runtime, not compile time. VLAs are a C99 feature.
tagged type
A type that has been tagged with a specific identifier, often used in C to distinguish between different kinds of structs or unions when type compatibility is important.
canonical type
A unique, normalized representation of a type within the compiler. The compiler uses canonical types to ensure type equivalence is checked correctly, even if types are declared in slightly different ways.
Filed Under: ccompiler-bug