Fortran: Fix IS_CONTIGUOUS descriptor access for PR126892
Correctly dereferences descriptor pointer in Fortran IS_CONTIGUOUS to fix ICE.
This commit fixes an internal compiler error (ICE) in the Fortran front-end related to the IS_CONTIGUOUS intrinsic function. Previously, the code incorrectly used a pointer to a descriptor directly, bypassing the necessary dereferencing. This led to the descriptor accessors receiving a pointer instead of a descriptor, causing the ICE. The fix dereferences the pointer to ensure the accessors receive the correct type, resolving the error and includes a new test case.
In Details
The gfc_conv_is_contiguous_expr function in gcc/fortran/trans-intrinsic.cc has been modified to correctly dereference the descriptor pointer before accessing its fields. The prior implementation stabilized the argument pointer and used it directly with descriptor accessors, which expected a descriptor object, not a pointer. This commit ensures the correct type is passed, resolving an ICE reported in PR126892.
- Fortran
- A high-level programming language commonly used for scientific and numerical computation.
- IS_CONTIGUOUS
- A Fortran intrinsic function that checks if an array's elements are stored contiguously in memory.
- Descriptor
- A data structure used by the Fortran compiler to represent an array, storing information about its shape, type, and memory location.
- Internal Compiler Error (ICE)
- An unrecoverable error that occurs during the compilation process, indicating a bug in the compiler itself.
- PR126892
- Problem Report number 126892, a unique identifier for a specific bug reported against the GCC compiler.