From patchwork Tue May 17 08:27:40 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: 54075 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 D721C3857407 for ; Tue, 17 May 2022 08:41:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D721C3857407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652776890; bh=1xqagtpEi7eg+aE4qNFv8yy1wvRQU80gQqD3djgJPig=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=rAhCJneDaEnsAcSh+PqyxC9anH9GBThxNMUOMbC22tv4OKu3oz2pgZRvLRq8OgzEY UxFOakurY12g08JkdX2OFhilnqbs6H1mnh7t6xiLpsKQKN0+anBsB0K+R9Yo7eHLch IkDelyxJsQiUpdZ+YFkHoSnL5XDzq0SknwCucqV8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 71B243857430 for ; Tue, 17 May 2022 08:27:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71B243857430 Received: by mail-wr1-x42f.google.com with SMTP id k30so10960125wrd.5 for ; Tue, 17 May 2022 01:27:42 -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=1xqagtpEi7eg+aE4qNFv8yy1wvRQU80gQqD3djgJPig=; b=xBfqVzk3hHtibVV7fv5Zp0blWyUJ9nZI4jci/QwLxAXxphr2KYI4ldTnAM4N7WPgfI 0ByiMA+8ZGqe88xbda7yG2dwdDATXWT9UFgurIA89FMna9c+jyrNmxy4+ts/E7+vojCn Jf2F5VrhXYIQa7XIIUmBqL9nbfzwEMN/LjPTizqrnOHrE/hiWcAq5y76MeElHvDg4SdI mbaeOwFgJ9feG5+jEBhOvSNxCG9kBDKRIUd0hwK2/8sk1elYkeMx6RCQefhsRkA0W91F RWpk+HKA0WIypmHHX3cXDiPIlCYRQ0a7oEX2pIf2VVS6H8HWnPT0lj4tT3wXswYihG8H MkZQ== X-Gm-Message-State: AOAM530/+gUhwUAd2cJQEUfIjvAp83n0/i/Ok/uc6qvAhxU8zpFdQvXD u7BTS/4lobMwwhTzLE7zy5kPiVdSrcItFXH+ X-Google-Smtp-Source: ABdhPJyyou9sEcjPwm0B7knr8+bhhQxb4C9m6FW7NZpN7ObRxOmOaWHXOvKXFLU4xYxuw4YB1/pGqQ== X-Received: by 2002:a05:6000:1815:b0:20a:deee:3cf0 with SMTP id m21-20020a056000181500b0020adeee3cf0mr17242000wrh.210.1652776061245; Tue, 17 May 2022 01:27:41 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id l5-20020adfc785000000b0020cdcb0efa2sm11506097wrg.34.2022.05.17.01.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 01:27:40 -0700 (PDT) Date: Tue, 17 May 2022 08:27:40 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Allow 'Reduce with -gnat2022 Message-ID: <20220517082740.GA1089269@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 Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" After a period of experimentation, allow 'Reduce in Ada 2022 mode. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.adb (Analyze_Attribute [Attribute_Reduce]): Allow 'Reduce for Ada 2022 and above. * sem_attr.ads (Attribute_Impl_Def): 'Reduce is no longer implementation defined. diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -5775,11 +5775,7 @@ package body Sem_Attr is when Attribute_Reduce => Check_E2; - - if not Extensions_Allowed then - Error_Attr - ("% attribute only supported under -gnatX", P); - end if; + Error_Msg_Ada_2022_Feature ("Reduce attribute", Sloc (N)); declare Stream : constant Node_Id := Prefix (N); diff --git a/gcc/ada/sem_attr.ads b/gcc/ada/sem_attr.ads --- a/gcc/ada/sem_attr.ads +++ b/gcc/ada/sem_attr.ads @@ -407,13 +407,6 @@ package Sem_Attr is -- as Range applied to the array itself. The result is of type universal -- integer. - ------------ - -- Reduce -- - ------------ - - Attribute_Reduce => True, - -- See AI12-0262-1 - --------- -- Ref -- ---------