From patchwork Thu Jun 15 08:04:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 71161 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2DBAF3853D11 for ; Thu, 15 Jun 2023 08:09:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2DBAF3853D11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686816547; bh=MJQJCtqS4rGgaKcgLPvV2+jNZcw74GQ4oRp2q8oh2TI=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=mFqAp0rnKYz/UHKRl3Qc2785VZ7M2524Y9bFhf2AxWIPjR1U6lJhYLCLPtq7UtGdF TZcV4qfChPwibeaHb5AQkfSoyUCFFWiDWTEvV1z+NM2YJErRC0ED3wOi8smarG9o+B X+94VuQ7GOw8TVg/sk7DKXbLDFsoV3gT8JChZlms= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id BCE5D3856DFE for ; Thu, 15 Jun 2023 08:04:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BCE5D3856DFE Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b3451b3ea9so23787501fa.1 for ; Thu, 15 Jun 2023 01:04:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686816261; x=1689408261; 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=MJQJCtqS4rGgaKcgLPvV2+jNZcw74GQ4oRp2q8oh2TI=; b=Lw4lJxzeyrOfxX09bOb2wZCMNiprcQ5dWa3hacvIC8U6c+uJ/wPzV9LDQIrcv+Zhss kdommDUa8iQIm0OWa0e1Xv2/nBau7Q4ScNQTu+3cCTxrOe4oDUZnRoxV5yqwyzEjAHRH PdX3yTOkSuwnb9jLWMgGIsMyZOu7AGRrnfjeJ4p7st34Hr9Gc3doGgnHOkf4ksPhcT5W xL0ve0+0iyc8nowpNfOAcCRXePsaV8jOxRJkFRiPIg9779LSUcSetVVQHyFDmK4GC/Yg 2GbeynPmV6JcWboc8DpRuHHgn/pNzo97CL2GU1RRIhFU8r3ysfBoh5xAoh3x19VMFQ9K YDXQ== X-Gm-Message-State: AC+VfDwSJTnDyyLkXAh/WtTs2aBaWCybMM8AFs6Ly8CnJSg60+UNuNtK AIzAvxd6tEm8eMLyonXmYY636/wWVbgc58KJ8JqMyQ== X-Google-Smtp-Source: ACHHUZ5jqfccSJoGtBCn/kRG82BOX6cZlTwlYAuKqq5frwL9iPAtpFqkLEX8sYfr9YcayNNBRM77tw== X-Received: by 2002:ac2:5b91:0:b0:4f6:14d1:5967 with SMTP id o17-20020ac25b91000000b004f614d15967mr8697749lfn.61.1686816261318; Thu, 15 Jun 2023 01:04:21 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id o16-20020a1c7510000000b003f7e6d7f71esm19730541wmc.36.2023.06.15.01.04.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 01:04:20 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Remove dead code in Expand_Iterator_Loop_Over_Container Date: Thu, 15 Jun 2023 10:04:19 +0200 Message-Id: <20230615080419.939862-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 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, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Eric Botcazou The Condition_Actions field can only be populated for while loops. gcc/ada/ * exp_ch5.adb (Expand_Iterator_Loop_Over_Container): Do not insert an always empty list. Remove unused parameter Isc. (Expand_Iterator_Loop): Adjust call to above procedure. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch5.adb | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index d8214bd6ce2..a4c7db9f365 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -181,14 +181,13 @@ package body Exp_Ch5 is procedure Expand_Iterator_Loop_Over_Container (N : Node_Id; - Isc : Node_Id; I_Spec : Node_Id; Container : Node_Id; Container_Typ : Entity_Id); -- Expand loop over containers that uses the form "for X of C" with an - -- optional subtype mark, or "for Y in C". Isc is the iteration scheme. - -- I_Spec is the iterator specification and Container is either the - -- Container (for OF) or the iterator (for IN). + -- optional subtype mark, or "for Y in C". I_Spec is the iterator + -- specification and Container is either the Container (for OF) or the + -- iterator (for IN). procedure Expand_Predicated_Loop (N : Node_Id); -- Expand for loop over predicated subtype @@ -4836,7 +4835,7 @@ package body Exp_Ch5 is else Expand_Iterator_Loop_Over_Container - (N, Isc, I_Spec, Container, Container_Typ); + (N, I_Spec, Container, Container_Typ); end if; end Expand_Iterator_Loop; @@ -5133,7 +5132,6 @@ package body Exp_Ch5 is procedure Expand_Iterator_Loop_Over_Container (N : Node_Id; - Isc : Node_Id; I_Spec : Node_Id; Container : Node_Id; Container_Typ : Entity_Id) @@ -5606,13 +5604,6 @@ package body Exp_Ch5 is Mutate_Ekind (Cursor, Id_Kind); end; - -- If the range of iteration is given by a function call that returns - -- a container, the finalization actions have been saved in the - -- Condition_Actions of the iterator. Insert them now at the head of - -- the loop. - - Insert_List_Before (N, Condition_Actions (Isc)); - Rewrite (N, New_Loop); Analyze (N); end Expand_Iterator_Loop_Over_Container;