Message ID | 20231219143034.454911-1-poulhies@adacore.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1978156dyi; Tue, 19 Dec 2023 06:32:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJUXkTZvEqtRq5Eh1t6zSnTcDTmvpBIRUWlAywdyVXgOHpG2RG0SfpLNlJjCNCeLnEAZ1D X-Received: by 2002:ac5:cc49:0:b0:4b6:cdb7:9818 with SMTP id l9-20020ac5cc49000000b004b6cdb79818mr1177833vkm.8.1702996328106; Tue, 19 Dec 2023 06:32:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702996328; cv=pass; d=google.com; s=arc-20160816; b=tk1+dtP/le+CjnBi94UpUDc35wAzI6FNeCJIVllBgL3Uh7QqNwO3HHYt5Cpsio0P5x zTU4Ht5/ENkuYIYRVEjVaBgyI3XU/ikJjD63YsStAHrX9AGl/olri//v/V3cMBLNC7BT 2YcVB7VsCbvPhT3wxA/W3ddCI6bMNwCQzR/Z0t99o6eZf+8bdRVY0d5yQrH3L6lpcyD8 M3rb9RK+0fsbti5SaXcuJUJ32bjGtACRiH0wfNk8bs10EsT5KKHfGqvHAzmyDq7BXqRY qhzLkAuERhZD2fuc11QLK3pi/8jazOI6ajXhVGUo75NRz/qJHyNc/Lnflh3uhnQ2dM/X zDLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=hrrYVhE07Wh7eZ2uUcxS1QGWEszq2wcLdVswcShO1vQ=; fh=hOhsC1930eHatDPYd2EALQ9Ry/g++vvN4vxlQkRuX+0=; b=aWfn9L8QUNh1ej+duik/05r0rpnYMrEE855Jm6dIXfPx7DSOp4SMDuWvUArNzlVDpL 9KIa6tD5bz8c329vnDH7pm6gbT/6dgIeQF6wTIR7lkQ8waAmFfzRj/JDwm37EfFRypAc sKevmUM/g8t48odrrekoA2JqhEEE9V0SQj/dbnyFF8Lm1i08hEEa+dbJwtXOIB4wig8w 6AovoxiMEvXRmSJB44uOmgC8cRj+pz+ruF+4NKd/G/aak86bKw0jtBkby7W4VMBDZGNT n08qWMHYQ3zQpiDrkE1okNxQlDIXlBP5y3I29qPJfzr9KEmhs86JcttoiImx2pm+/7Xl VBeg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=LOoCFhkb; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d7-20020a1f4f07000000b004b4e69b6281si3657821vkb.227.2023.12.19.06.32.07 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:32:08 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=LOoCFhkb; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E01F4386F443 for <ouuuleilei@gmail.com>; Tue, 19 Dec 2023 14:31:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 7FEBA386F001 for <gcc-patches@gcc.gnu.org>; Tue, 19 Dec 2023 14:30:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7FEBA386F001 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7FEBA386F001 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::430 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702996237; cv=none; b=YgmsYJQiN5DqtWQmzKVFkkFu/d8PEc93lmO9vJQ9u4KX+sY1XtTsQ3RijIeZzNv9hFwsNdzWi0ZpbVBSLvlwGkPRYTbOIO2bmQyRNRi/M8I7mJwMD/+6oa14wspfRrov+64T/xLRSLbhBM56zdC47fl9buPaI5I5aBoXcO9idtk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702996237; c=relaxed/simple; bh=FCBovFaOLf/ntIjdJ49gTYYIzUhXGipXEd+5QrRz+Kw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=SkW5b1WLIOTop32SZ6ZR4DPL+ZOUGwszxcw5PpcQ8IMbgw4r3mNSzw2EuTtp3LJ0+mN0nCKcvVjlbobAf207zVjj2qSD4EJfmxF9uWAfSJMEWnzvXr/olEIkgVOAkKoqB3yMNBmuJpihZJrM7QDG/ODXKqUfRfOF8aEnt66SuiQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-336437ae847so4899674f8f.2 for <gcc-patches@gcc.gnu.org>; Tue, 19 Dec 2023 06:30:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1702996235; x=1703601035; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hrrYVhE07Wh7eZ2uUcxS1QGWEszq2wcLdVswcShO1vQ=; b=LOoCFhkbGjuXgiyRX/lcjX+G+O3rmPYHB+sKGKTrjZwRyU9IN7lcaoqpBhdA5nDBVQ cOPrfy3DTSl4MLb2FBC9ftIJOEDFCns0e3U1fykjMo+LZR2bFNSANN+mu77yNupo2iHA L30AczygxZNSTuRlCzXvxbjUbmkqJG6r7PBCgn8k22Ex3sbmt3ltSKReIxdYGN1IlLC7 GHfyyXf/Qt2wPnhr4blb4d1Uofg33Ig4RhVoZSd/9jSWP97nfGSH1+bIA52KXAUgzKfG ZGuVuK2Knt+a+zhW4uUzn4G4sLihoJrwjLBaTsdX93noZBKY7yKeZpRc6vqUBohbUx8O QVCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702996235; x=1703601035; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hrrYVhE07Wh7eZ2uUcxS1QGWEszq2wcLdVswcShO1vQ=; b=X+VTLzeyRPZZahMBUGmy3xxkf4mzS+UT8/Yz++D0LXbFhjfLh8X77jX9CWYqiRbTF+ GuPCB9f3A2feYrMP92uWyjkkePTfWo2Alnt9O5TfngtCHsF9XgpcfFEkpJaAQPpFdHi8 8yY8y0c2JkqUao2DK0xHj5KgyVJAIKrRO0MoWsPCXnrVbd/PePjqcIDUZzcJ+EdsFf3G HL72VH3/fc02esof0sQjnOYwoPIzPUWk3Wcbl7BqixdtdWrrWx8lJbx1IXKcyyzHJwMd sqWSrvNMRvvHARxWV1HeIjb+28AgOkYw6fGlwxw1AMWVNAGblgmuTXMao6Sm/KOFsEiv rKcw== X-Gm-Message-State: AOJu0Yy28QUtbbQjGCyestb1m6VK9/leZTGEgTs0Uze/ExwGfFag08+j SXoGCP0UfNPUONjEKQldF/EfFedPi6tz8V8seHY= X-Received: by 2002:a05:600c:2047:b0:40c:3dd7:98dc with SMTP id p7-20020a05600c204700b0040c3dd798dcmr9348555wmg.75.1702996235365; Tue, 19 Dec 2023 06:30:35 -0800 (PST) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:fe1e:443:c34f:edaa]) by smtp.gmail.com with ESMTPSA id a21-20020a05600c349500b0040c4be1af17sm3224405wmq.21.2023.12.19.06.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:30:34 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou <ebotcazou@adacore.com> Subject: [COMMITTED] ada: Plug small loophole in finalization machinery Date: Tue, 19 Dec 2023 15:30:33 +0100 Message-ID: <20231219143034.454911-1-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 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> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785721077810366200 X-GMAIL-MSGID: 1785721077810366200 |
Series |
[COMMITTED] ada: Plug small loophole in finalization machinery
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Marc Poulhiès
Dec. 19, 2023, 2:30 p.m. UTC
From: Eric Botcazou <ebotcazou@adacore.com>
The path in Expand_N_If_Expression implementing the special optimization for
an unidimensional array type and dependent expressions with static bounds
fails to call Process_Transients_In_Expression on their list of actions.
gcc/ada/
* exp_ch4.adb (Expand_N_If_Expression): Also add missing calls to
Process_Transients_In_Expression on the code path implementing the
special optimization for an unidimensional array type and
dependent expressions with static bounds.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/exp_ch4.adb | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 8f4cf0808dc..527ca16aac4 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -5912,6 +5912,14 @@ package body Exp_Ch4 is and then not Generate_C_Code and then not Unnest_Subprogram_Mode then + -- When the "then" or "else" expressions involve controlled function + -- calls, generated temporaries are chained on the corresponding list + -- of actions. These temporaries need to be finalized after the if + -- expression is evaluated. + + Process_Transients_In_Expression (N, Then_Actions (N)); + Process_Transients_In_Expression (N, Else_Actions (N)); + declare Ityp : constant Entity_Id := Base_Type (Etype (First_Index (Typ)));