summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-24 14:44:59 +0000
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-24 14:44:59 +0000
commit69dcb06f6c200b1034805f8b96eb2094a20c62c3 (patch)
treeca2129b91aa3bac51e447ae5d0bf0b803df2e510 /gcc/fortran/trans-expr.c
parent44f86782ae907bcf32815df5d767a0c5e1e078fe (diff)
downloadgcc-69dcb06f6c200b1034805f8b96eb2094a20c62c3.tar.gz
Fix gfortran.dg/class_to_type_4.f90 deallocation code misordering failure
PR fortran/64986 gcc/fortran/ * trans-expr.c (gfc_trans_assignment_1): Put component deallocation code at the beginning of the block. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226162 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 89b4dfd3443..be6bfe2006d 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -9241,7 +9241,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
if (scalar_to_array && dealloc)
{
tmp = gfc_deallocate_alloc_comp_no_caf (expr2->ts.u.derived, rse.expr, 0);
- gfc_add_expr_to_block (&loop.post, tmp);
+ gfc_prepend_expr_to_block (&loop.post, tmp);
}
/* When assigning a character function result to a deferred-length variable,