From patchwork Tue May 23 08:08:42 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: 97877 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1979414vqo; Tue, 23 May 2023 01:24:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4vr7qBisrfgv5z5Lgc1jzx56v6SjLlwmUr4g9IO2n2wLjk0zv/qoUfvJLvVBNq9qlautZL X-Received: by 2002:a17:907:d0c:b0:96f:ab92:aed2 with SMTP id gn12-20020a1709070d0c00b0096fab92aed2mr11084348ejc.58.1684830296449; Tue, 23 May 2023 01:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684830296; cv=none; d=google.com; s=arc-20160816; b=ezDpax/JfrWP5EugGTBMUnK8uyFj8TGBsRw8POxZZwl15w2pCV7iQRmCIQ4A0K/WXo ZPThfekC2S3hTf5kY4Z8e1ABaUYOUJnrbxu2+mRbt4fC921Dx3h38PwfEz3h8gtuqpzJ Rxvm9brqafnCCxgV4u+fdvx0DwvXv83z0pd3S/um7n5T/kcr1dEg9htc+yqK0hEvlmPY /rhV5IlhBavo8VkrkUr8Y7AiP9Ou4kp2EbMZ2Dnch4KF0W5/hVtJVk2HIkJnAUV/7fZb O4LTU8SbpKOwaR5Vw2eYIM+ZGuJSKfJrU9kKOV0tFFQFWn46y1Sct5NulUXBGpnilqMo 8jNg== 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=WpAgK+oel6MhOBLl9dDPkOT84jb9o0MiJhHSX/iyjG8=; b=TfVrLMHmvQqKsXnpeDXULY7ZS8ilflZ7R+2ZU//Is6c0vCXB8UYYykwZAV8UAkyslK Cs8VYhNskVX/EswfYY4dZzYNFR5Xjpip/5kexWlTsVR20eBLLmCS9nxETjnfLPqbX3pO kEuuOFsxeCUXh4I8709lSR37lH9Q41zcp0eh3Z8H08I/z48DYRLDbSX6oOCeYIIXSCKd kTWcj4VBNhmEJlu6vfCc/i0OJ1I4oTRqph2S9jZ0D/Vt6t3fXqYVdLl9n8hLAzdyTQf1 NBNj4ZDaXtWWstyXj67gzZ9yS2DcbsihoKLhjgaKT4/WNCa1ayoacQOPdphc9vab04Xx m+kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KBhmkx4I; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id a6-20020a17090682c600b0094f7edff334si170321ejy.688.2023.05.23.01.24.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 01:24:56 -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=KBhmkx4I; 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 276E03982428 for ; Tue, 23 May 2023 08:15:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 276E03982428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684829743; bh=WpAgK+oel6MhOBLl9dDPkOT84jb9o0MiJhHSX/iyjG8=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=KBhmkx4Idt/bqZzZPT258pfCYdzd8m2DpZTAOExOMLvlFdgNPWZdeKx2gx9UrfXVj wBWtwAch41EGEAfRNac1UBFzvrMWju3EsZSylce1cBaL8kkt109L28UJ4OfgvZTvlz ynyAfE7HXWGAD90+C+wPKTUsbndMtBLBiN/JT5bA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 8F1DA3882174 for ; Tue, 23 May 2023 08:08:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F1DA3882174 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f42ba32e24so45431935e9.3 for ; Tue, 23 May 2023 01:08:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684829324; x=1687421324; 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=WpAgK+oel6MhOBLl9dDPkOT84jb9o0MiJhHSX/iyjG8=; b=YUVPeix/Izm7yfs+P7lLMz8fQbMDHW3ExhT4eYGUprD3yCuNPEfkLdMY2cUBRtIpZg s7DqfRAinKI/2iu0IdAv5/mgnpa4+ZXC6VHs9aYMvqAKHZz2u6kKq5Bcc29FoDFjQn4I 5MM0DspxmaRrzSL/hxUa34TYOOzbBSvwAdBkz1uEUiOVBkPb/YLVCivzLY2X7SErAyLI Zo1KYS68innj5Fs2/gv7ZfCNGMHVBdiVwBPHrlVcPw/8o7ZGAf3ifV0Ey5rChZ0cqsb0 SFt5/u35xSmz7xVQKyGILOcK9ugPW6gAzpXGK9LLgpKdvj71ASM+6y8qXcjctd959WO7 Icbg== X-Gm-Message-State: AC+VfDzrnPXldYXW544v5QjnRctSidZl64pHmuGrXqht9xlHyvxD5b4b pOd6cTpZUTpwczmauLiaTG09bgBdrPUyEMdBLaEeLw== X-Received: by 2002:a05:600c:2257:b0:3f6:900:4b6a with SMTP id a23-20020a05600c225700b003f609004b6amr1653847wmm.1.1684829324387; Tue, 23 May 2023 01:08:44 -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 s4-20020a5d4244000000b00307bc4e39e5sm10104355wrr.117.2023.05.23.01.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 01:08:43 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Vadim Godunko Subject: [COMMITTED] ada: Remove unnecessary call to Detach. Date: Tue, 23 May 2023 10:08:42 +0200 Message-Id: <20230523080842.1874165-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 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?1766672612600779604?= X-GMAIL-MSGID: =?utf-8?q?1766672612600779604?= From: Vadim Godunko Holder object is constant and protected from modification by tampering rules. gcc/ada/ * libgnat/a-coinho__shared.adb (Constant_Reference): Remove call of Detach (Query_Element): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a-coinho__shared.adb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gcc/ada/libgnat/a-coinho__shared.adb b/gcc/ada/libgnat/a-coinho__shared.adb index 367089048af..f49ac4ad817 100644 --- a/gcc/ada/libgnat/a-coinho__shared.adb +++ b/gcc/ada/libgnat/a-coinho__shared.adb @@ -149,8 +149,6 @@ package body Ada.Containers.Indefinite_Holders is raise Constraint_Error with "container is empty"; end if; - Detach (Container); - declare Ref : constant Constant_Reference_Type := (Element => Container.Reference.Element.all'Access, @@ -305,8 +303,6 @@ package body Ada.Containers.Indefinite_Holders is raise Constraint_Error with "container is empty"; end if; - Detach (Container); - B := B + 1; begin