https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126895
--- Comment #3 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:f566fd3c966da60a1cc7db15e0a17e926325949c commit r17-3327-gf566fd3c966da60a1cc7db15e0a17e926325949c Author: Mikael Morin <[email protected]> Date: Sat Aug 15 21:54:06 2026 +0200 fortran: Make IS_CONTIGUOUS true for assumed-rank scalars [PR126895] If the argument to IS_CONTIGUOUS is an assumed-rank variable, add a condition making the intrinsic return true if the variable rank is zero at execution time. With the testcase, the function returned false despite the rank, because the check of the span against the element size, that compared unequal, was not guarded by a rank check. PR fortran/126895 gcc/fortran/ChangeLog: * trans-intrinsic.cc (gfc_conv_is_contiguous_expr): If the argument to IS_CONTIGUOUS is an assumed-rank variable, add a conditional making the value true if the runtime rank is zero. gcc/testsuite/ChangeLog: * gfortran.dg/is_contiguous_7.f90: New test.
