===================================================================
@@ -5819,6 +5819,13 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol *
INTENT_IN,
fsym && fsym->attr.pointer);
}
+ else if (fsym && fsym->attr.contiguous
+ && !gfc_is_simply_contiguous (e, false, true))
+ {
+ gfc_conv_subref_array_arg (&parmse, e, nodesc_arg,
+ fsym ? fsym->attr.intent : INTENT_INOUT,
+ fsym && fsym->attr.pointer);
+ }
else
gfc_conv_array_parameter (&parmse, e, nodesc_arg, fsym,
sym->name, NULL);
===================================================================
@@ -8,6 +8,8 @@
subroutine test1(a,b)
integer, pointer, contiguous :: test1_a(:)
+ integer, target, dimension(3) :: aa
+ test1_a => aa
call foo(test1_a)
call foo(test1_a(::1))
call foo(test1_a(::2))
@@ -56,9 +58,3 @@ contains
end subroutine bar
end subroutine test3
-! Once for test1 (third call), once for test3 (second call)
-! { dg-final { scan-tree-dump-times "data = origptr" 1 "original" } }
-! { dg-final { scan-tree-dump-times "_gfortran_internal_pack .&parm" 2 "original" } }
-! { dg-final { scan-tree-dump-times "_gfortran_internal_unpack .&parm" 2 "original" } }
-
-