Fix ICE in GIMPLE parser caused by VLA-type _Literal [PR128606]
Corrected GIMPLE parser to handle Variable Length Array types in _Literal expressions, resolving an Internal Compiler Error.
An Internal Compiler Error (ICE) occurred in the GIMPLE parser when processing _Literal expressions involving Variable Length Array (VLA) types, such as svuint8_t from <arm_sve.h>. This commit replaces a problematic call to TYPE_VECTOR_SUBPARTS(type).to_constant() with constant_lower_bound(), which correctly determines the number of elements for VLAs, thus fixing the ICE and adding new test cases.
In Details
The c_parser_gimple_postfix_expression function in gimple-parser.cc previously mishandled VLAs within _Literal expressions. Specifically, it used TYPE_VECTOR_SUBPARTS(type).to_constant() to determine vector allocation size, failing for vector-length agnostic types. This commit rectifies this by substituting constant_lower_bound(), ensuring correct size calculation for such types and resolving the ICE reported in PR128606. New tests target SVE vector types on AArch64.
- ICE
- Internal Compiler Error. A severe error that occurs during the compilation process, indicating a bug within the compiler itself.
- GIMPLE
- Generic Intermediate Representation. An intermediate representation used by GCC, designed to simplify analysis and optimization passes.
- VLA
- Variable Length Array. An array whose size is determined at runtime, rather than at compile time. VLAs are a C99 feature.
- _Literal
- An expression used in C code to define an array of literal values, often used for immediate data embedded in the program.
- SVE
- Scalable Vector Extension. An optional extension to the ARM architecture that provides powerful vector processing capabilities.