diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2012-02-29 07:21:38 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2012-02-29 07:21:38 +0000 |
commit | 5cda350e60df32b728d1cf4a346a980d5870193c (patch) | |
tree | 6711111812b41f509f252bc2a50d75120d9584f4 /gcc/fortran/trans-expr.c | |
parent | b7c8e77fbf781f7d4a773e3aec742c27582a63f8 (diff) | |
download | gcc-5cda350e60df32b728d1cf4a346a980d5870193c.zip gcc-5cda350e60df32b728d1cf4a346a980d5870193c.tar.gz gcc-5cda350e60df32b728d1cf4a346a980d5870193c.tar.bz2 |
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
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index ec21838..3552da3 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -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); |