From patchwork Wed May 18 08:43:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 54138 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 B85363857815 for ; Wed, 18 May 2022 09:00:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B85363857815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652864445; bh=5nxbLaDwujaPD7MK0ZZPfDB5Kp1qwn1wjMnCEHvwFp4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=VG7M/U7ZAN0GeKW0NqKHmhqFtKp3W6I8Smqq+BrhQwfvqJjuiZYOpmLb9lSjgQhwY BYS9aKD6U5Sk6PixF72llqZ+K2b74lUiM9nWvaI/+vabr2DpGH8S1k+ifb0NIelc7O xb++tun2NSafLjK8T1/vW4zUYSV+364Kj8AXbuR4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id A9D4B3858434 for ; Wed, 18 May 2022 08:43:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A9D4B3858434 Received: by mail-wr1-x42b.google.com with SMTP id t6so1648225wra.4 for ; Wed, 18 May 2022 01:43:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=5nxbLaDwujaPD7MK0ZZPfDB5Kp1qwn1wjMnCEHvwFp4=; b=dXqvyQruFJiVpzOXVebNJ8UPWwLoxB7ml8VwWOhl7Qg0FUzKeNT6np82rQuzn1lnRq U5+0fIo8BqvxDP9ytx3fYKwP3suqQ9N7+rRtXQl92hzwDb3ks79pecbpmvIV+nr1q+5H pmIBbIcxuqO0YNsqe+bwRs/fTl8m9PfgP40iR4K5gKO8auQ3g5oBxdUAN+c7tJd5ZdzG l2ZpSAeAUDIl0i3PoO8VwBfypML+0N4lsmrI4wH1P45vT6vV7lDaWeN+8ggcS9fHerLF 1byQIfC8dFTaufLHw4QqGth7xisWynCbWXGL0oL/g8KwVp9pm+vOjl7vb0jaAZjciUsF yLGA== X-Gm-Message-State: AOAM532vuHc45+7QNtgV0lQLabcM+LbfIFH70sqQJV8iHLj54CMrCdL/ jM4uTMeNi9Jb3HCHUGvjvdUEZ4HKXPbo2g== X-Google-Smtp-Source: ABdhPJyKIdsOjutoHJ+dLy4+i+Fm4+7RDS0zsI/+eOxzUBspPh5YGkmS1qSRxHIIk9FcqNKqp9MbZw== X-Received: by 2002:adf:c041:0:b0:20d:2cd:f30f with SMTP id c1-20020adfc041000000b0020d02cdf30fmr15251832wrf.208.1652863400307; Wed, 18 May 2022 01:43:20 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id m4-20020adfa3c4000000b0020c5253d909sm1350379wrb.85.2022.05.18.01.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 01:43:19 -0700 (PDT) Date: Wed, 18 May 2022 08:43:19 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Use specific predicate before manipulating BIP_Alloc_Form Message-ID: <20220518084319.GA3349069@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.2 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: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Eric Botcazou Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" For the sake of consistency with other similar manipulations. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Use Needs_BIP_Alloc_Form. diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -2850,16 +2850,14 @@ package body Exp_Ch7 is Left_Opnd => New_Occurrence_Of (Fin_Mas_Id, Loc), Right_Opnd => Make_Null (Loc)); - -- For constrained or tagged results escalate the condition to + -- For unconstrained or tagged results, escalate the condition to -- include the allocation format. Generate: -- if BIPallocform > Secondary_Stack'Pos -- and then BIPfinalizationmaster /= null -- then - if not Is_Constrained (Func_Typ) - or else Is_Tagged_Type (Func_Typ) - then + if Needs_BIP_Alloc_Form (Func_Id) then declare Alloc : constant Entity_Id := Build_In_Place_Formal (Func_Id, BIP_Alloc_Form);