Commit 2b58638b by Paul Brook Committed by Paul Brook

re PR fortran/17678 (USE statement incorrectly initializes allocatable array)

	PR fortran/17678
	* trans-array.c (gfc_trans_deferred_array): Leave use associated
	variables alone.
testsuite/
	* gfortran.dg/use_allocated_1.f90: New test.

From-SVN: r88655
parent d1d52531
2004-10-07 Paul Brook <paul@codesourcery.com>
PR fortran/17678
* trans-array.c (gfc_trans_deferred_array): Leave use associated
variables alone.
2004-10-06 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/17568
......
......@@ -3999,8 +3999,8 @@ gfc_trans_deferred_array (gfc_symbol * sym, tree body)
&& !INTEGER_CST_P (sym->ts.cl->backend_decl))
gfc_trans_init_string_length (sym->ts.cl, &fnblock);
/* Parameter variables don't need anything special. */
if (sym->attr.dummy)
/* Parameter and use associated variables don't need anything special. */
if (sym->attr.dummy || sym->attr.use_assoc)
{
gfc_add_expr_to_block (&fnblock, body);
......
2004-10-07 Paul Brook <paul@codesourcery.com>
PR fortran/17678
* gfortran.dg/use_allocated_1.f90: New test.
2004-10-06 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/17849
......
! { dg-do run }
! PR17678
! We were incorrectly setting use-associated variables to unallocated
! on procedure entry.
module foo
integer, dimension(:), allocatable :: bar
end module
program main
use foo
allocate (bar(10))
call init
end program main
subroutine init
use foo
if (.not.allocated(bar)) call abort
end subroutine init
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