From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 3E9AE385AE4D for ; Mon, 26 Sep 2022 09:15:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3E9AE385AE4D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x335.google.com with SMTP id iv17so4023278wmb.4 for ; Mon, 26 Sep 2022 02:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=rU5qQwh536vPx785tHUaJv/hrSrZ+rMenh26CJmcLB8=; b=G9Q5JxnZvJ+cJT552aJLahm2nbLIEKhixcGcqgjkk++88hJ5aJw0dYsCw1bVPsBB2d 8qRYtLYOb9fiwgEJ/DfpgyOyWB7Bd+ESdkzOPGSsJLDW3/60oM6DYF6sgwIE2VyMZUrK hUYKbSWCKwgr1XzH6uXIz5SY9NklFu8xJGfF+O9+POCgDG4MU8yaExD6KGNuD4LrrG66 +4SkP+L0qCJpO5b3rRC7sS7ZLjr1K0NdK0eZ9eMxRzTky0eCJqmrNBSdPPhoRvTyW4xc Ge3Cd9tqBSewAa6lZaIBF+opb+kU3WBdn0qZKQVmUr5YeQM2NKyUMr5kaBIp3eewdjQY FeWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=rU5qQwh536vPx785tHUaJv/hrSrZ+rMenh26CJmcLB8=; b=L3zTf+6uikGBQ8fRZ8XusyHVHzvXz8lj+CX9P8wYwoQWHk71IndgkM5P0/oEws2ExX ppYvnbgmbmesgMbYN7i0uU3EFbHAhzuS6tLoRM+O22PEvnSlYVkstOGntduVBqX7+5VH JxzRusP/BqWZ0zFChU64VNHgKKOeM24pQPE0bVlo4eR3jC4oqBZgUg/ABtlmY+msN8Nv 1+xYLbbIc7urvNfQcoPzAo85TFHc82jBD0xKudPDmHNIeUeQW9ADaz3GY2v85mYmaOfV sd0cEBh5YQ8WvCLhZGkA/ONEUVNCwZ8985aAdMKllVx/2RYPjX+Z2zUbK2Td5K61idJh dO3Q== X-Gm-Message-State: ACrzQf2aTlzubaW+rkTMHY6BuxPO0SuhF98L8MKZvt5CtBPntQeiHauL QO4C08LjykSuILV/tscqiHMCj37yjfVtFQ== X-Google-Smtp-Source: AMsMyM5/fP4QPbixeivuEx4x56pvpxewrZ9eaZGk4crfLsLcmmgYD+heNHLKm6v+TkeDOvfIQNEi7A== X-Received: by 2002:a7b:ca54:0:b0:3b4:fb06:9b1 with SMTP id m20-20020a7bca54000000b003b4fb0609b1mr14206583wml.67.1664183710145; Mon, 26 Sep 2022 02:15:10 -0700 (PDT) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id u7-20020a05600c4d0700b003b4e009deb2sm11708288wmp.41.2022.09.26.02.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 02:15:09 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITED] ada: Delay expansion of iterator specification in preanalysis Date: Mon, 26 Sep 2022 11:15:05 +0200 Message-Id: <20220926091505.273202-1-poulhies@adacore.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.1 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 List-Id: From: Piotr Trojanek When preanalysing spec expression (e.g. expression of an expression function), the name of iterator specification should not be expanded. This patch simplifies a complicated condition for delaying expansion within quantified expressions and iterated component associations. gcc/ada/ * sem_ch5.adb (Analyze_Iterator_Specification): Delay expansion based on Full_Analysis flag. --- gcc/ada/sem_ch5.adb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 6d07f3d09e5..d0f00b31161 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2429,14 +2429,9 @@ package body Sem_Ch5 is if not Is_Entity_Name (Iter_Name) - -- When the context is a quantified expression or iterated component - -- association, the renaming declaration is delayed until the - -- expansion phase if we are doing expansion. - - and then (Nkind (Parent (N)) not in N_Quantified_Expression - | N_Iterated_Component_Association - or else (Operating_Mode = Check_Semantics - and then not GNATprove_Mode)) + -- Do not perform this expansion in preanalysis + + and then Full_Analysis -- Do not perform this expansion when expansion is disabled, where the -- temporary may hide the transformation of a selected component into -- 2.25.1