| Message ID | 20260602084541.3829876-41-poulhies@adacore.com |
|---|---|
| State | Committed |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3330A4BA23E1 for <patchwork@sourceware.org>; Tue, 2 Jun 2026 09:03:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3330A4BA23E1 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=GNmUBEi+ X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 546724BA2E19 for <gcc-patches@gcc.gnu.org>; Tue, 2 Jun 2026 08:46:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 546724BA2E19 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine 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 546724BA2E19 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389991; cv=none; b=EXYNqzib/FURozpV2Dzkad0YI62HwooIZ9iTReu2VpTYqoyJjdLeg/SLam1AmksC+VNr08L76Dr3BGPV4grWRJwn61eT6C/9vyGCTE7M7rk4wfFYglWzPSjYG7uMqTLC7CT59JJvLXW8375Ys1KHDtEtLUwxOncdEOfGnfo/WOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389991; c=relaxed/simple; bh=+9YXdx9rP4WQjb14Q10rORV/R8f4DWx/4AQEpc+AWJE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mwC3R/hzSfIfyuPlFI+HCYWGe6k0Zg1NBbFjhPmaDKPzASSzqzMLuemnqjycrNw1ZoCI8JZW/W8SL3w9ZHFOQDkE/KSh9hDqUraEQLob+qRG0b6pIFFJMqxVlrjCcKSU60iDGW4YQ0d9MZgfzx3xGwI1FeXL1o+/5gdHi0JqfNY= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=GNmUBEi+ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 546724BA2E19 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4903d730b1fso99644495e9.2 for <gcc-patches@gcc.gnu.org>; Tue, 02 Jun 2026 01:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389990; x=1780994790; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QhqbPDo85BHryg9VKfwJIFmHIBpd/UXfqq1z8DOByeI=; b=GNmUBEi+YruFHCFhmpQ2tixmkFgmj/gIc5bk1mZKudhrTKsGXYOD6K5Z3BHNyA7m2t KiSUwh9Q4QK4YIlBgTqBL6tuAU5Hdmo2LMHjVUm2H1oqqIYYwNM92HEQoU0aZMmrqmGg LdEPqETKm6eINCCQl9tHRGtpICqVA486fxDAq8zQI4s+tLUj9d1Jj49HQY58HpD5q2o7 wTQdTF0+kxzBXbR++J6rfCozRyrAnG2ZOttS3u7jhVZK981cdz5uhM72f5UE4zEJ5ish aX+1USri6lXo2/fHLwZK9FaPhLsl2PPQy1A6P6MXqpqsY/OVFCVydMBGUI1K6kEx83vn I5bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389990; x=1780994790; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QhqbPDo85BHryg9VKfwJIFmHIBpd/UXfqq1z8DOByeI=; b=gxrVXywjAVIY3FctmV/6uzdj1C0lH3XaYTKjSxuFboUdDOcOXK1eCJfS4ZtiCFRjvi NSmuRK79rrMk1PZJQwzdgmxTlM9QBAC/bF7Zg/P7gGOwA9W37CU3y1fm3ikQ5uWqTwgE Dee7p8kL0StctYaiFnqbcSKT3JdCslLopQV/0BH5bZ/YoVtA/PddfNHdwaIRZGGbc7Fs ylfJQ+5vkmP66z1mnpaFOChS/2ep/ykSiX9Lnn9ZbKPwHVcTpQNG9J2yfl2bV0+GsbYR SqXsLT9sqriUkqSvHbYKUnP1o7Uz4/LCyNvqVB1aYcEgbNalRba82YC3pfxOqyAs4cYz 2ztA== X-Gm-Message-State: AOJu0YxP9heg3gAKtdoCAeR7YZ2xM+BFHhrx9QF1w8CNZuW5VqF78zea DnslSwGtB/AbjPDf6AU2TauOlyvg1EqVP4I2YycnoDNq/h9pq0hhdn3Xk7BKFo/ltNfvmT3vwXh IQkM= X-Gm-Gg: Acq92OECg+xLkgp8kra6wwfy8wCG7J/0bZ7wUkI//yzsrRxED27cG6w9pbIAuc0qu0U KYBAaBZnYtlp9kVKapYjS0INQ7aD/QITveueW3T78NuNSExy44YEpcwmrIKv06qYpdS9J9OCw8L AbP70F2QPVSv6DVdxlEqiq9jrw+brcQX+wq228gjbYiGqjnw8sIDjCr6jdUvaWPfMEEu+Dls60U 4IPMJKn2uKZ7trc5/vzIhF+/4GZNzF37VfdBtzGspT+2GsTFehfo/aodO3h/aUZl3BU8Rsa0NBi eMay3Wr70RGtnH8tQ9sosrudLYxiqymFEwiDbBkp3zRL145hbYQMVLE+S5jMxjJ9eq5wnhi97tX ei+qkbC/TZjE2mGOTVHRhbxPm2SDfOd/83kDiCK4qng1GwL/yyylTozjQjLewkrncAMz6UcoUXV dr+5PsXz6JVrjCva8UysGoTWl7bjF18QnmhTUErJovhFvJf4isSfjaVaBornXPm9IHq3cY8wD8I NapuQwhNA9JwmIRTZpKeTvSsFkB5MA= X-Received: by 2002:a05:600c:870c:b0:490:b2a6:8c2a with SMTP id 5b1f17b1804b1-490b2a68d50mr23284725e9.5.1780389990327; Tue, 02 Jun 2026 01:46:30 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:29 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> Subject: [COMMITTED 41/51] ada: Adjust expansion disabling for ghost expression functions Date: Tue, 2 Jun 2026 10:45:29 +0200 Message-ID: <20260602084541.3829876-41-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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~patchwork=sourceware.org@gcc.gnu.org |
| Series |
[COMMITTED,01/51] ada: Rename Private_Component function
|
|
Commit Message
Marc Poulhiès
June 2, 2026, 8:45 a.m. UTC
When analyzing a Ghost expression function, expansion was disabled, which was an issue when some entities needed to be frozen (which is often the case as expression function are often the first freezing point of entities). The previous change: "Warn on unmodified parameters of expression functions" now triggers the disabling of the expander because it marks the body of expression function as "coming from source". This change adjust the disabling condition by excluding body coming from expression function. gcc/ada/ChangeLog: * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not disable expander if body comes from an expression function. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch6.adb | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 568b7d46db6..fd12a557108 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -3743,9 +3743,14 @@ package body Sem_Ch6 is -- user entities, as internally generated entitities might still need -- to be expanded (e.g. those generated for types). + -- Do not disable expansion if the body comes from an expression + -- function as they are often the first freezing point of entities and + -- expansion is needed to freeze them properly. + if not CodePeer_Mode and then Present (Ghost_Config.Ignored_Ghost_Region) and then Comes_From_Source (Body_Id) + and then not From_Expression_Function then Expander_Active := False; end if;