diff options
| author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-28 05:16:19 +0000 |
|---|---|---|
| committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-28 05:16:19 +0000 |
| commit | e5387fb99fe093bfb88341e8dfc667ea3556c307 (patch) | |
| tree | f04a8d72271d3d34abda6a4ef6ffa6676d1561bd /gcc/fortran/trans-expr.c | |
| parent | 1f63a7d666901121bd8e1a65478855d735fac9a0 (diff) | |
| download | ppe42-gcc-e5387fb99fe093bfb88341e8dfc667ea3556c307.tar.gz ppe42-gcc-e5387fb99fe093bfb88341e8dfc667ea3556c307.zip | |
2009-04-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/39879
* trans_expr.c (gfc_conv_procedure_call): Deep copy a derived
type parentheses argument if it is a variable with allocatable
components.
2009-04-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/39879
* gfortran.dg/alloc_comp_assign_10.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146871 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-expr.c')
| -rw-r--r-- | gcc/fortran/trans-expr.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 2b67c6ddcd3..77a2dfae356 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1119,7 +1119,8 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len) gfc_add_modify (&se->pre, var, tmp); /* Free the temporary afterwards. */ - tmp = gfc_call_free (convert (pvoid_type_node, var)); + tmp = gfc_call_free (var, true, &gfc_current_locus, + ALLOCTYPE_TEMPORARY); gfc_add_expr_to_block (&se->post, tmp); } @@ -2782,7 +2783,18 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, break; } + if (e->expr_type == EXPR_OP + && e->value.op.op == INTRINSIC_PARENTHESES + && e->value.op.op1->expr_type == EXPR_VARIABLE) + { + tree local_tmp; + local_tmp = gfc_evaluate_now (tmp, &se->pre); + local_tmp = gfc_copy_alloc_comp (e->ts.derived, local_tmp, tmp, parm_rank); + gfc_add_expr_to_block (&se->post, local_tmp); + } + tmp = gfc_deallocate_alloc_comp (e->ts.derived, tmp, parm_rank); + gfc_add_expr_to_block (&se->post, tmp); } |

