]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: IS_CONTIGUOUS and pointers to non-contiguous targets [PR114023]
authorHarald Anlauf <anlauf@gmx.de>
Fri, 24 Oct 2025 19:33:08 +0000 (21:33 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Sat, 1 Nov 2025 19:10:44 +0000 (20:10 +0100)
commit31d3f96b790c76df14e6328fd600d616ca969abd
tree0ac469c37fce14892bb644683d55329cec2b030a
parent696bfbab0a46ccc263cffd88254582d236a84278
Fortran: IS_CONTIGUOUS and pointers to non-contiguous targets [PR114023]

PR fortran/114023

gcc/fortran/ChangeLog:

* trans-expr.cc (gfc_trans_pointer_assignment): Always set dtype
when remapping a pointer.  For unlimited polymorphic LHS use
elem_len from RHS.
* trans-intrinsic.cc (gfc_conv_is_contiguous_expr): Extend inline
generated code for IS_CONTIGUOUS for pointer arguments to detect
when span differs from the element size.

gcc/testsuite/ChangeLog:

* gfortran.dg/is_contiguous_5.f90: New test.

(cherry picked from commit 3f8b6373f48af0eabbc2efe04df8f6856add3111)
gcc/fortran/trans-expr.cc
gcc/fortran/trans-intrinsic.cc
gcc/testsuite/gfortran.dg/is_contiguous_5.f90 [new file with mode: 0644]