]> 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, 25 Oct 2025 14:42:15 +0000 (16:42 +0200)
commit3f8b6373f48af0eabbc2efe04df8f6856add3111
tree62f8329022ec31c5165ca467e0456aa401969f78
parentbc8abe881e925b6cdae4179666a7d3ddbc26e215
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.
gcc/fortran/trans-expr.cc
gcc/fortran/trans-intrinsic.cc
gcc/testsuite/gfortran.dg/is_contiguous_5.f90 [new file with mode: 0644]