Commit 5cda350e by Paul Thomas

re PR fortran/52386 (ICE in gfc_conv_descriptor_dtyp (realloc LHS related))

2012-02-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/52386
	* trans-expr.c (fcncall_realloc_result): Dereference the
	descriptor if needed.

2012-02-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/52386
	* gfortran.dg/realloc_on_assign_13.f90 : New test.

From-SVN: r184651
parent b7c8e77f
2012-02-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/52386
* trans-expr.c (fcncall_realloc_result): Dereference the
descriptor if needed.
2012-02-22 Tobias Burnus <burnus@net-b.de>
PR fortran/52335
......
......@@ -6299,6 +6299,8 @@ fcncall_realloc_result (gfc_se *se, int rank)
/* Use the allocation done by the library. Substitute the lhs
descriptor with a copy, whose data field is nulled.*/
desc = build_fold_indirect_ref_loc (input_location, se->expr);
if (POINTER_TYPE_P (TREE_TYPE (desc)))
desc = build_fold_indirect_ref_loc (input_location, desc);
/* Unallocated, the descriptor does not have a dtype. */
tmp = gfc_conv_descriptor_dtype (desc);
......
2012-02-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/52386
* gfortran.dg/realloc_on_assign_13.f90 : New test.
2012-02-28 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
PR target/51534
......
! { dg-do compile }
! Test the fix for PR52386.
!
! Contributed by Juergen Reuter <reuter@physik.uni-freiburg.de>
!
module cascades
implicit none
private
contains
function reduced (array)
integer, dimension(:), allocatable :: reduced
integer, dimension(:), intent(in) :: array
logical, dimension(size(array)) :: mask
mask = .true.
allocate (reduced (count (mask)))
reduced = pack (array, mask)
end function reduced
end module cascades
! { dg-final { cleanup-modules "cascades" } }
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