From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) by sourceware.org (Postfix) with ESMTPS id 384DB3858439 for ; Thu, 13 Jul 2023 08:52:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 384DB3858439 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=gcc.gnu.org Received: from cyrano.home ([86.215.161.51]) by smtp.orange.fr with ESMTPA id Js3wqzoJKtImzJs43q0yVW; Thu, 13 Jul 2023 10:52:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1689238363; bh=7nwXXGawt6y99sPvGpAXwtXoq8nxFKIF5Bon2KnbnzA=; h=From:To:Subject:Date:In-Reply-To:References; b=lLCw1MD2Ee6yEDiY8y5bJ0+uFSSd/YuVLsDRdINYzz3MjWisY+dcY2WSC3VOUEwCc uuMppHtqcA4525wa7kPbTnaT7mEJ/zxknk23doLfihLNML0rqPi4e1MaSbW0gwnekY 3G2h+dv6d3Gs0NtOvfip8CfjN5PkQjahJCfwMCHIEYL2oxtMQmsS2Hh/5+4KxXUxoQ iE+IiKDbNAGTjcKkn0b0guUch+PgJmqJp12aiHBM+6+JDKet12pw3C28YWzIP60TMQ GNZp2+q8fvK/n6SlOWy1A16i7qgcqGWmNwR18ObHpSsB5kPPBCp92LPUsHgl1+9HpW cEFOZsj6aO5Rw== X-ME-Helo: cyrano.home X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Thu, 13 Jul 2023 10:52:43 +0200 X-ME-IP: 86.215.161.51 From: Mikael Morin To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 05/14] fortran: Add missing cleanup blocks Date: Thu, 13 Jul 2023 10:52:27 +0200 Message-Id: <20230713085236.330222-6-mikael@gcc.gnu.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230713085236.330222-1-mikael@gcc.gnu.org> References: <20230713085236.330222-1-mikael@gcc.gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NEUTRAL,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. --- gcc/fortran/trans.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/trans.cc b/gcc/fortran/trans.cc index f8ca388ab9f..5c953a07533 100644 --- a/gcc/fortran/trans.cc +++ b/gcc/fortran/trans.cc @@ -1391,8 +1391,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) -- 2.40.1