[Bug fortran/126895] Wrong IS_CONTIGUOUS result for pointer assumed-rank scalar values
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Aug 17 08:25:34 GMT 2026
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 <mikael@gcc.gnu.org>:
https://gcc.gnu.org/g:f566fd3c966da60a1cc7db15e0a17e926325949c
commit r17-3327-gf566fd3c966da60a1cc7db15e0a17e926325949c
Author: Mikael Morin <mikael@gcc.gnu.org>
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.
More information about the Gcc-bugs
mailing list