diff options
author | Mikael Morin <mikael@gcc.gnu.org> | 2023-07-17 14:13:37 +0200 |
---|---|---|
committer | Mikael Morin <mikael@gcc.gnu.org> | 2023-07-17 14:13:37 +0200 |
commit | a4519a884d0215740581c051641364f5368c0450 (patch) | |
tree | bda5f1afcd914f042c1c56a73677aee1d44cf62a /gcc/fortran | |
parent | 8c4d0fe3c28e8cb48cd8ff629fbd4068048562c7 (diff) | |
download | gcc-a4519a884d0215740581c051641364f5368c0450.zip gcc-a4519a884d0215740581c051641364f5368c0450.tar.gz gcc-a4519a884d0215740581c051641364f5368c0450.tar.bz2 |
fortran: Add missing cleanup blocks
Move cleanup code for the data descriptor after the finalization code
as it makes more sense to have it after.
Other cleanup blocks should be empty (element size and final pointer
are just data references), but add them by the way, just in case.
gcc/fortran/ChangeLog:
* trans.cc (gfc_add_finalizer_call): Add post code for desc_se
after the finalizer call. Add post code for final_se and
size_se as well.
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/trans.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fortran/trans.cc b/gcc/fortran/trans.cc index 2af433d..7fcaf8e 100644 --- a/gcc/fortran/trans.cc +++ b/gcc/fortran/trans.cc @@ -1390,8 +1390,12 @@ gfc_add_finalizer_call (stmtblock_t *block, gfc_expr *expr2) desc_se.expr, size_se.expr, boolean_false_node); - gfc_add_block_to_block (&tmp_block, &desc_se.post); gfc_add_expr_to_block (&tmp_block, tmp); + + gfc_add_block_to_block (&tmp_block, &desc_se.post); + gfc_add_block_to_block (&tmp_block, &size_se.post); + gfc_add_block_to_block (&tmp_block, &final_se.post); + tmp = gfc_finish_block (&tmp_block); if (expr->ts.type == BT_CLASS && !has_finalizer) |