https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122977
Steve Kargl <kargl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #3 from Steve Kargl <kargl at gcc dot gnu.org> ---
(In reply to anlauf from comment #1)
> Mine.
>
> Untested fix:
>
> diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
> index 9f3ce1d2ad6..66929f714cc 100644
> --- a/gcc/fortran/resolve.cc
> +++ b/gcc/fortran/resolve.cc
> @@ -18143,6 +18217,7 @@ skip_interfaces:
>
> /* F2008, C530. */
> if (sym->attr.contiguous
> + && !sym->attr.associate_var
> && (!class_attr.dimension
> || (as->type != AS_ASSUMED_SHAPE && as->type != AS_ASSUMED_RANK
> && !class_attr.pointer)))
I've tested this patch on amd64-*-freebsd. It fixes the OP's problem,
and regression tests pass. OK to commit as obvious.
I haven't looked at the issue with gfc_is_simply_contiguous() in
comment #2, but if it passes regression testing, and you have a
testcase (or two) feel free to commit. The comment in the patch
explains the rationale.