Commit 7f0d6da9 by Erik Edelmann

re PR fortran/28416 (ICE on allocatable codes)

fortran/
2006-07-24  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/28416
        * trans-array.c (gfc_conv_array_parameter): Give special treatment
        for ALLOCATABLEs if they are themselves dummy variables.

testsuite/
2006-07-24  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/28416
        * gfortran.dg/allocatable_dummy_3.f90: New.

From-SVN: r115721
parent 0dca5a92
2006-07-24 Erik Edelmann <eedelman@gcc.gnu.org>
PR fortran/28416
* trans-array.c (gfc_conv_array_parameter): Give special treatment for
ALLOCATABLEs if they are themselves dummy variables.
2006-07-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2006-07-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/25289 PR fortran/25289
......
...@@ -4524,7 +4524,13 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77) ...@@ -4524,7 +4524,13 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
} }
if (sym->attr.allocatable) if (sym->attr.allocatable)
{ {
se->expr = gfc_conv_array_data (tmp); if (sym->attr.dummy)
{
gfc_conv_expr_descriptor (se, expr, ss);
se->expr = gfc_conv_array_data (se->expr);
}
else
se->expr = gfc_conv_array_data (tmp);
return; return;
} }
} }
......
2006-07-24 Erik Edelmann <eedelman@gcc.gnu.org>
PR fortran/28416
* gfortran.dg/allocatable_dummy_3.f90: New.
2006-07-24 Steven G. Kargl <kargls@comcast.net> 2006-07-24 Steven G. Kargl <kargls@comcast.net>
PR fortran/28439 PR fortran/28439
! { dg-do run }
! PR 28416: Check that allocatable dummies can be passed onwards as non-assumed
! shape arg.
program main
implicit none
integer, allocatable :: a(:)
interface
subroutine foo(v_out)
integer, allocatable :: v_out(:)
end subroutine foo
end interface
call foo(a)
if (any(a /= [ 1, 2, 3 ])) call abort()
end program
subroutine foo(v_out)
implicit none
integer, allocatable :: v_out(:)
allocate(v_out(3))
call bar(v_out, size(v_out))
end subroutine foo
subroutine bar(v, N)
implicit none
integer :: N
integer :: v(N)
integer :: i
do i = 1, N
v(i) = i
end do
end subroutine bar
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment