aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2014-07-07 20:04:05 +0000
committerPaul Thomas <pault@gcc.gnu.org>2014-07-07 20:04:05 +0000
commit3af52023d752c432b9ef7e90d8c75576efebf7ab (patch)
treea2bc4f9a4d4060ebbf286b8fe2fc12faa345bf3a /gcc/fortran/trans-expr.c
parent72732f3ef0f08c0547228a295c1f3a00907d061b (diff)
downloadgcc-3af52023d752c432b9ef7e90d8c75576efebf7ab.zip
gcc-3af52023d752c432b9ef7e90d8c75576efebf7ab.tar.gz
gcc-3af52023d752c432b9ef7e90d8c75576efebf7ab.tar.bz2
re PR fortran/61459 (segfault when assigning to allocatable function result from matmul result)
2014-07-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/61459 PR fortran/58883 * trans-expr.c (fcncall_realloc_result): Use the natural type for the address expression of 'res_desc'. 2014-07-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/61459 PR fortran/58883 * gfortran.dg/allocatable_function_8.f90 : New test From-SVN: r212339
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index dba51b0..81f2137 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -6518,7 +6518,7 @@ gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr)
tmp = build_fold_indirect_ref_loc (input_location, se->expr);
tmp = gfc_deallocate_alloc_comp (expr->ts.u.derived, tmp, expr->rank);
-
+
/* The components shall be deallocated before
their containing entity. */
gfc_prepend_expr_to_block (&se->post, tmp);
@@ -7302,7 +7302,7 @@ fcncall_realloc_result (gfc_se *se, int rank)
res_desc = gfc_evaluate_now (desc, &se->pre);
gfc_conv_descriptor_data_set (&se->pre, res_desc, null_pointer_node);
- se->expr = gfc_build_addr_expr (TREE_TYPE (se->expr), res_desc);
+ se->expr = gfc_build_addr_expr (NULL_TREE, res_desc);
/* Free the lhs after the function call and copy the result data to
the lhs descriptor. */