[COMMITTED] ada: Fix wrong optimization of extended return for discriminated record type
Message ID | 20230915142104.2101183-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:612c:172:b0:3f2:4152:657d with SMTP id h50csp1086202vqi; Fri, 15 Sep 2023 07:25:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8kGfWPRFXbpo7XiTiXbuNP9vEGuUxnIICZQYghpM5jlqcAtXl9ukFLKelJXrp3Sb2wHLt X-Received: by 2002:a17:906:8456:b0:9a5:9f8d:770 with SMTP id e22-20020a170906845600b009a59f8d0770mr1279935ejy.46.1694787947925; Fri, 15 Sep 2023 07:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694787947; cv=none; d=google.com; s=arc-20160816; b=GpeEuG8RyrfGMLYJ4tiR2aLr+ckjivyMWh/WH+kJAwngnSHOmTCfe8TPWzwn1q7dWD k/emSTn9Xtd0rbTy4ipFRjO8hnxIOpyUQkRr5UIUyqb5U2vN6r285LowhDFlAOmmvS62 YCfKbiq9Y6WjvZebNaqWegs64CgNb6lZub3PfI7OKRfEzReR2uno2Rwm76naORYEpdmq /V4muA6gs5aTnzpnxa836wH5TAqsz47V55J53RE2Y0KJOfWt+RL+ABhxMDwgNFxDujE2 O/KcynjaO4NZUdk+mtcggyn4QnFmGPo0vaMvCQZL8OGc2UnW9l52PT2H+dY3PDkg0CJd jCqw== 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:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=xacODtqlxy02heF9vsOS9wBeJlfBmRp/ofv+rG8USUQ=; fh=hOhsC1930eHatDPYd2EALQ9Ry/g++vvN4vxlQkRuX+0=; b=Pc/vu11AL48HV4ofEXnO5n0gDyGgLBWPkUMCTbkYR5wXC7kjcE6qyPMLmkw7GOzkq6 xOeVPatr31rBRIR/YaqD6QLFZ6XN9Fj5kwsiAsw3ltIMtknZ+d6pMJiSNnq+D9nWRaTo 6Ks6pGXjYoCYvpHKoz+ghX5LQV2lJzpgRUbwCc1lCDAZ1c0ebjnk1q1i+yp7+rxKQxMw yi9D6ZpEeSfwQ9V1GFEXYiu9iNxmL0GUkSyDTLl5Pg0+mI4W8A1iEcPOlGCXnxG5Pb6G IeYQzKwuulaiE/dM81iJqlicIpv7q/yJVxNCKd53L55GJAI9DST74AQXZq9VUP5DV5i5 IuQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=UrhAnMK0; 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 n4-20020a170906088400b00993afed2932si3571003eje.324.2023.09.15.07.25.47 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 07:25:47 -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=UrhAnMK0; 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 441F73853D11 for <ouuuleilei@gmail.com>; Fri, 15 Sep 2023 14:24:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 441F73853D11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694787842; bh=xacODtqlxy02heF9vsOS9wBeJlfBmRp/ofv+rG8USUQ=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=UrhAnMK0gtTKaXZ5pOObexsBW9l3bpbHAiqI30A38CHNAPrTXuksBp+iH8qgEu4Ex 1TgvqiQUi+ehSUMxbAVdpAfBd3ssKvSNy7BtXKlPJoy4+3HeMfSBRziAix5raNrTpD tUkjICsY0yaoBZIZm2zT08M0AXg2tdGyiQRHQHb4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 9DC1F3858C36 for <gcc-patches@gcc.gnu.org>; Fri, 15 Sep 2023 14:21:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DC1F3858C36 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31fe2c8db0dso1635803f8f.3 for <gcc-patches@gcc.gnu.org>; Fri, 15 Sep 2023 07:21:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694787665; x=1695392465; 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=xacODtqlxy02heF9vsOS9wBeJlfBmRp/ofv+rG8USUQ=; b=aF6ckZoBuGkStcPJMZ5tpaaFzhObwlwx5DND0vXm1Da5mVRoeYMvFwOXeWWWbCSseT JV3CqO9IC+hPGJNaUR7w8BT9oSncPBUnORWrOop99boQexQ5EHdspcKfnQpHa4BzxyRD 60xpV9bXNz+b2keVoMQLtRlY3xjYJgYGPf27ISfsjxbqCxJBM3co8FV8K//D/spBuqNB deza8hDZlaCUUYNyAvE8x8VxiANAcb4t94eGhvSeyWOh0cLPJz/3sO6fKfitlse529oV UmX/9h2JTzoFwjkTckBgqqhK61AzVyyWA6kUybtoVDSC6F4HEd2Os+wusT1+5IcR3DGk OYmw== X-Gm-Message-State: AOJu0YxhelCHMujqIA05eLlcKI0OVn9gCAIPl/5eI/M0xAZOs0HH6TaD M0laMhDc0qLGscPGKou2cNVlt7v10WPKHVK5emjO8g== X-Received: by 2002:a5d:4442:0:b0:319:7656:3863 with SMTP id x2-20020a5d4442000000b0031976563863mr1807216wrr.47.1694787665421; Fri, 15 Sep 2023 07:21:05 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:a63c:a2c3:ab34:f429]) by smtp.gmail.com with ESMTPSA id ci8-20020a5d5d88000000b0031fedb25b85sm2275196wrb.84.2023.09.15.07.21.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 07:21:05 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou <ebotcazou@adacore.com> Subject: [COMMITTED] ada: Fix wrong optimization of extended return for discriminated record type Date: Fri, 15 Sep 2023 16:21:04 +0200 Message-Id: <20230915142104.2101183-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.7 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 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> From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= <gcc-patches@gcc.gnu.org> Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> 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: 1777113966858971631 X-GMAIL-MSGID: 1777113966858971631 |
Series |
[COMMITTED] ada: Fix wrong optimization of extended return for discriminated record type
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Marc Poulhiès
Sept. 15, 2023, 2:21 p.m. UTC
From: Eric Botcazou <ebotcazou@adacore.com>
This happens when the discriminants of the record type have default values.
gcc/ada/ChangeLog:
* inline.adb (Expand_Inlined_Call): In the case of a function call
that returns an unconstrained type and initializes an object, set
the No_Initialization flag on the new declaration of the object.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/inline.adb | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index db8b4164e87..4e8d0f1bb74 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -4157,6 +4157,7 @@ package body Inline is Object_Definition => New_Copy_Tree (Object_Definition (Parent (Targ1)))); Replace_Formals (Decl); + Set_No_Initialization (Decl); Rewrite (Parent (N), Decl); Analyze (Parent (N));