From patchwork Tue May 16 08:41:38 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: 94529 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp273113vqo; Tue, 16 May 2023 01:49:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5PfPwZGBs3RXJ0phm/9CL/bthY7ZmJda2NRAUyDxsukfoP5NjL0QGotSVzwPFYR2/VvGXX X-Received: by 2002:a05:6402:185a:b0:50d:82f9:6867 with SMTP id v26-20020a056402185a00b0050d82f96867mr29122887edy.31.1684226963008; Tue, 16 May 2023 01:49:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684226962; cv=none; d=google.com; s=arc-20160816; b=ID2nuL/EbUdAKntL7HOUB6jcsKvkyAM67Nl8QxuFVsRtUEZneA2mHKYkac3irHFHeO P10G37cGLmUaful8nOf6hjqHn3LlHcjHpb08hwO4e2WNIsJMwFNt7Inh5ecF9FnzuSqk Re+k4XGEAIZKP/GmxjATGg86cduH2MhfnCpYqFsWuv0pxi60c8xdBundInvBjNfnVD3v jNQSgbTKJ2JNE1MBUy3FqukcTEpJ93dV0KUTp6ICfTgx1ZqGJ6/8fTcTKWAnPeXFQd/x 1wPYJfKGLT+xZ4tkx/AbYHWmmKc6ViIzO2yOJsdL61iagRqjNf3oBp9pum0JrPT0BoDQ Yxrw== 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=naLeV1ulRioHI9RQCof9L0B3bxN1fmkU8Y7TcsbOPbM=; b=HyF4C72FjS9ts2Ncsm8lmIbJ3u6jFwV6aQHBkKlSAcC4aNlKxXY9edqBJxDfBrkBZB OC7p5v3amOc3xf5ZJXH5MpImT/I2j/w0HBz2xsVk4qxfuZ9Sbk98tF3bcTz528EhPyET 20VzNnJJyoqxhxadnKLDugYs/0zk4PFoDccsUvZqE+DrzC8/bHFKUW19qaZdHmIfAIza TYJ/j835wlj8x6XoBVMbhLH2Qt4ZGSFgU5Ket5rYUdFM44SYY4X8qBu64IfybMWxBPNL cwpkQdM+P8YIAubJi6dNC7XgGbnjteWT4A0XpIPMfBoD6Q2WDeZ272nnrPr+48QEDovz ZxLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=WcJja9lX; 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=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id r16-20020a056402035000b0050bc8a3dce3si12508630edw.81.2023.05.16.01.49.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 01:49:22 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=WcJja9lX; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 95D33388267B for ; Tue, 16 May 2023 08:44:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95D33388267B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684226667; bh=naLeV1ulRioHI9RQCof9L0B3bxN1fmkU8Y7TcsbOPbM=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=WcJja9lXZOKkBBqnw/LwZAxa0i9YrEljtTV83JRRJau/hqpzE/ZtkjjyE9XXv9LDu XLMDGxXcRuTz6FcHQEC/J+dCGGIYEiITPZiBfaq2XnA8/BR1cYrytWHeBez+RuGJEF B0SW+i4SJclkoV36kWSEN9FS3bBbdujqLiGcqr+4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 11D79385383D for ; Tue, 16 May 2023 08:41:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 11D79385383D Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-30786c87cdaso10934322f8f.2 for ; Tue, 16 May 2023 01:41:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684226500; x=1686818500; 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=naLeV1ulRioHI9RQCof9L0B3bxN1fmkU8Y7TcsbOPbM=; b=On38Z8SXNPtEXp1PpeA61v9Wvd9q8nhO15k5Isj2ddVAD8EBjqZfEUtcsXqYw27ZcC tSQSI8+5Jv2sfcA7aVGYnonv36Jratizhie4kK/UIiUEeePBOfUIxJtEMxxb8D+w07BG 3t4sNLORpebNHGyKUcCTX7tpOt0MvFPRmRogFHn5ow1hueulB4A57BEcQfQ2DqgQNAGF uhyHxPr9al6YTJ0z2MM86pKW1wELvhEZYtRO4QZngdFrNFDo5qHME7NDz443Lw4BZseo DkCXpyyws2VxsN12jdG5YDKSqX50V5EglHFCjq/9u19mMK9OEK4vlJtfFpLQoR7B/FAq 8/Qg== X-Gm-Message-State: AC+VfDyc+y6+RnmekD33W4l4laD9IxaUBnksxw4omluodtNhT0GJAre0 4wgs2p3/eUA4Rf2+Hdj2V/Hx7NxgPsgFKq76Zq8toA== X-Received: by 2002:adf:cd0a:0:b0:306:320f:7bd7 with SMTP id w10-20020adfcd0a000000b00306320f7bd7mr27810913wrm.41.1684226499898; Tue, 16 May 2023 01:41:39 -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 b4-20020adfde04000000b0030632833e74sm1797465wrm.11.2023.05.16.01.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 01:41:39 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Fix missing warning on aggregate with iterated component Date: Tue, 16 May 2023 10:41:38 +0200 Message-Id: <20230516084138.1502460-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 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.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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766039972368327193?= X-GMAIL-MSGID: =?utf-8?q?1766039972368327193?= From: Eric Botcazou This happens when the iterated component does not really iterate. gcc/ada/ * exp_aggr.adb (Expand_Array_Aggregate): Do not set Warnings_Off on the temporary created when in-place expansion is not possible. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index cf8bac0f4bf..fe61e0ec90b 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -7068,7 +7068,6 @@ package body Exp_Aggr is Defining_Identifier => Tmp, Object_Definition => New_Occurrence_Of (Typ, Loc)); Set_No_Initialization (Tmp_Decl, True); - Set_Warnings_Off (Tmp); -- If we are within a loop, the temporary will be pushed on the -- stack at each iteration. If the aggregate is the expression