[Bug fortran/126892] ICE when there is a call to IS_CONTIGUOUS of a pointer assumed-rank dummy

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126892

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Mikael Morin <[email protected]>:

https://gcc.gnu.org/g:968c8e7dd702cf0c4d1932393c79d58ea4b84492

commit r17-3311-g968c8e7dd702cf0c4d1932393c79d58ea4b84492
Author: Mikael Morin <[email protected]>
Date:   Sat Aug 15 18:48:01 2026 +0200

    fortran: Dereference descriptor pointer in IS_CONTIGUOUS code [PR126892]

    In the IS_CONTIGUOUS implementation, add the missing dereference to really
    have a descriptor-typed expression, usable with the descriptor accessors.

    Without this change, the pointer resulting from the evaluation of the
    IS_CONTIGUOUS argument was stabilized to a variable and then directly used
    to access the descriptor fields.  This was causing an internal compiler
    error because the descriptor accessors aren't prepared to receive a
pointer.

            PR fortran/126892

    gcc/fortran/ChangeLog:

            * trans-intrinsic.cc (gfc_conv_is_contiguous_expr): Dereference the
            pointer variable before using it as descriptor.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/is_contiguous_6.f90: New test.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.