Message ID | 20230713085236.330222-6-mikael@gcc.gnu.org |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1686826vqm; Thu, 13 Jul 2023 02:01:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlFcYOZjgblWdN53oAnEdvTTH/SfSJQqruaR3u9FmtsBzyY9x/G6u7vmCD8Q+AK5YZVnRf7D X-Received: by 2002:a17:906:4a44:b0:98e:2423:708 with SMTP id a4-20020a1709064a4400b0098e24230708mr757139ejv.62.1689238877801; Thu, 13 Jul 2023 02:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689238877; cv=none; d=google.com; s=arc-20160816; b=NEYdNY3TVh8MyvCzGbF+x+/Iw9HbxDtU9d/bbqqzwCOlR4nxiQ/1xHLQ0Zphv9lp5w bYRd36pKMciGm3TKneqE+JT1pqACyqfQAjLolLYY6JIMsKqu1AMGmYMG367cQ/fFlh0f wjhgQQVyHxWOnXFzXtvppLcreHuMZ0L6N4R/25So78/L7fAir7HE0xYwm4A/8XDIb9ys cHY2TvzNfUA4SZSF62yH4A/LOIKj/nu4CZEy4oAK5Qq5aygYhPPj/3SDBbh7R/PGzMvd 8YBW2aWCixvhuyaOkjyrTbe6rMJeo3BB3La6F7z+ROtU2RcvGoIvDykK4lma6VKdkz8f fgbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=7nwXXGawt6y99sPvGpAXwtXoq8nxFKIF5Bon2KnbnzA=; fh=EAqAZnhg4AYtcBjfPm18lEF5V0R2rkI9MSWQf+svVaI=; b=OW0k0UQ95oyZsYTVvL+cmJdMs7ZRehkfY3lerwwv4MaoPrA9wkVjO717M9XcoxA/4s jqJJZM/ce3H+V5ucqsrkRfnOutVkeppFPRDvcQeegaRL5VIQxTHRU4AnKSXl0teIUlQj kX73Yvv3PM1slEkXDgUIHbmBxPorOZu3gKRVlR9SIOC2tOXkinaqkO1uU1oCUuG4Wnnx rQIFJaRY0T74qui3mZ8ClXTqGCWQZiJ1wkqYmZ+dfV9udh5WMQtpUhUUKR8P6htI4JHA R93fnBH7vsfs17CSI6XYJ4spGYLa31wlAD0AZxCQN5m7oLSuYsHTiqF+8n0lWt2MbN6H pw6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XEVRPGMr; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u9-20020a1709067d0900b00988e942e12csi6979245ejo.716.2023.07.13.02.01.17 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 02:01:17 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XEVRPGMr; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B02FC385266A for <ouuuleilei@gmail.com>; Thu, 13 Jul 2023 08:55:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B02FC385266A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689238541; bh=7nwXXGawt6y99sPvGpAXwtXoq8nxFKIF5Bon2KnbnzA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=XEVRPGMrCaczmhpJhxVLv1mrLRgEzRkReJMf/rSmOL4M0Jheb1rQ0sr83nIyIASnw Er0uGDO136KsULbYDqeInVVyEUZlN4pMZbHvrpbCOa0ehdLc89bjQLV5861RMpvhM1 +M0Lwc+6aDKkCvcRQFIwf2uv7NH7KhrSwqgzM+kI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) by sourceware.org (Postfix) with ESMTPS id 3B195385828E for <gcc-patches@gcc.gnu.org>; Thu, 13 Jul 2023 08:52:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B195385828E Received: from cyrano.home ([86.215.161.51]) by smtp.orange.fr with ESMTPA id Js3wqzoJKtImzJs43q0yVW; Thu, 13 Jul 2023 10:52:43 +0200 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 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=-11.8 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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Mikael Morin via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Mikael Morin <mikael@gcc.gnu.org> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771295345791001666 X-GMAIL-MSGID: 1771295345791001666 |
Series |
fortran: Use precalculated class container for deallocation [PR110618]
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Mikael Morin
July 13, 2023, 8:52 a.m. UTC
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)