From patchwork Mon Sep 5 07:25:52 2022 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: 965 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp56839wrt; Mon, 5 Sep 2022 00:29:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR4pocUZPS5Tdp9xKNxni8Z9j67nT7HqCf+4X5fXYrWVN4TuNAZ6HpnvS1fmC19QIF8Xg8H3 X-Received: by 2002:a05:6402:3583:b0:43d:6943:44a with SMTP id y3-20020a056402358300b0043d6943044amr41393908edc.409.1662362975399; Mon, 05 Sep 2022 00:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662362975; cv=none; d=google.com; s=arc-20160816; b=n7V4fHMd5+MNqVMgy647Q0Rbsyj0SUmSqDdr76pFXMiFMN/Bugk42rM83BSZDIS7qf qQv0cl15c9/oqkY/1P7kduM/vArmjhrzdqCY1Afx+NEkZoZWGKhQFtX7F/o44uf20KAg XuSwyiA/30sIwJ0kGVNyirG7Fd8L69Ytv0Kx/SDogDugOzof6+kjwue052dF8lgpsoo2 WpE0H0clWsUMYNhHBQdoePueDUXyoS9buazHYVlnXy5IDEhHi+hUbzLK4WYL87i0CKdo ptvSQn1VNuRlmJNzbBwACdviPsdhlQKlLlASGbDtgc7b7EDWAPI3uCSUdC7vT6yiCl9A kz6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=i7jMEqXaSrJOjw3Y/RCJGeLYYsIeinXd5PBaIpbYJcU=; b=qiXK7DXMIJE7RjhB2m28ih/rEVd6t/RHDZuwP1LhEKka7rrLbgcROSFwggFRxg2LOs 01PKvvklbhfTTE3r8S9+M+BQ+EFPzA4dVMAFFh328/8UV0tpXzsw3KJolVNRF6HSRQp3 mpjZEDDjY6GGWRN98I7ezvVqIp9p3f2rNcdObeqPdsrwQH1D+zF1RVK14NDKSsjLBkT7 rdnEbStw+l3WPcuNZUKEdwyafV8cS0Zm729WX06TjfI+BBuZsv0XPJn0G6118CmWwF8T A7wwbK/KjCncxqJeE7LU53se5lOtT5KHiYHMHcUd2RiRKaDeSO/GVEan0ur1tiyVFV4d y5Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gYMkcf3G; 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 sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a88-20020a509ee1000000b00448d4580be5si5924650edf.583.2022.09.05.00.29.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 00:29:35 -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=gYMkcf3G; 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 6694F3850227 for ; Mon, 5 Sep 2022 07:27:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6694F3850227 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662362862; bh=i7jMEqXaSrJOjw3Y/RCJGeLYYsIeinXd5PBaIpbYJcU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=gYMkcf3GxzEnydhDR5qvNblXUyPSdJjJ2Cs6Xf47+mCCojJfJdbpC1uOxlpmm4MB/ kbMHQa1cPAj0jnFClFUFs4INORJ7jdZJhouuEaaguz8AJrjm+qeGKiyGmR1QzExZrv mJe/IzYhdNYCKCNPlrBY8PPE1fEmAQ59kYWVGM5M= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id A59123858C62 for ; Mon, 5 Sep 2022 07:25:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A59123858C62 Received: by mail-wr1-x435.google.com with SMTP id e20so10045085wri.13 for ; Mon, 05 Sep 2022 00:25:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=i7jMEqXaSrJOjw3Y/RCJGeLYYsIeinXd5PBaIpbYJcU=; b=hsHe1eluJzI4hM1mcghEiydnBeXtltvkr9xhxxNELoGDPM/o8QQ/658s3thfUS6q5w +HA5xPGNonbT+/NNrvLZjbyzH7nDzGNrLhXLsgwYewcCb8cVbwhFUZZnD7e28uxIzQ6s FIhzK3H8dKhxcOxwQNJ3RB6xHzgWGJ2QBxyZ4N+acB2VdYTF3DA2I0cF953QFXnRbeaA HwlDLsisfoSNIvoI+J4ZYyhwg2QeXsIf72GyVW0Ld6u4is7V1Wt35lq+RKkoPqpRUDKH Tk7KtksfHCG0RX56HeWn/+lm+AOT1/Mk/0goAOt/2LFWKkIt+MGDDl1JmK8nbN3r78U2 Ux6w== X-Gm-Message-State: ACgBeo1HoZjU55eeKUNYWd4g8IqX+DzUcxXEYMCYgvSON86ziVOkyPx8 SWlTaLIGYvQVKKD40Y7kEIjKxfwhilmnPg== X-Received: by 2002:a05:6000:18a2:b0:221:7db8:de02 with SMTP id b2-20020a05600018a200b002217db8de02mr23715850wri.132.1662362753504; Mon, 05 Sep 2022 00:25:53 -0700 (PDT) Received: from poulhies-Precision-5550 (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id f6-20020adff586000000b00228c375d81bsm517227wro.2.2022.09.05.00.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 00:25:53 -0700 (PDT) Date: Mon, 5 Sep 2022 09:25:52 +0200 To: gcc-patches@gcc.gnu.org Subject: [Ada] Remove excessive guards against inserting empty lists of actions Message-ID: <20220905072552.GA1174512@poulhies-Precision-5550> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-12.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, 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: Marc =?iso-8859-1?q?Poulhi=E8s?= Cc: Piotr Trojanek 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?1743113919344760176?= X-GMAIL-MSGID: =?utf-8?q?1743113919344760176?= Call to Insert_Actions with empty list does nothing, so there is no need to guard against such calls. Code cleanup; behavior is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * freeze.adb (Freeze_Itype): Remove excessive guard. * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Likewise. diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -9653,9 +9653,7 @@ package body Freeze is Set_Has_Delayed_Freeze (T); L := Freeze_Entity (T, N); - if Is_Non_Empty_List (L) then - Insert_Actions (N, L); - end if; + Insert_Actions (N, L); end Freeze_Itype; -------------------------- diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -3365,9 +3365,7 @@ package body Sem_Ch5 is declare Flist : constant List_Id := Freeze_Entity (Id, N); begin - if Is_Non_Empty_List (Flist) then - Insert_Actions (N, Flist); - end if; + Insert_Actions (N, Flist); end; end if;