https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93956
--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- So, the problem seems to be that sym->attr.subref_array_pointer is not set on the original test case. It should be set by p => get(r(:)) (or by an equivalent call get2(r)) because we don't know what the particular subroutine may be doing.