From patchwork Thu May 19 14:16: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: 54226 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 9F0333839C5D for ; Thu, 19 May 2022 14:37:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F0333839C5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652971027; bh=Lkd22x6EnS3eW23vEJ51h1mO3ELm/EXBMUTVnYuy5MI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=JWIN91DxthcUaMoPWkca9LNVWKWNnGR3sF9NKozlTXuR2jcTCYTDtruAg8n8A94oO dQDmKzAwt2Z3h7WEginb5AE8vGkYKR31+JoR9VNp/54JMqxBJzG9GtIn0dttrd+nQB 5DxT1aN9dpLvXptKFXe7D7Z4EDqZRvNvLKvAALf4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 4467D383E820 for ; Thu, 19 May 2022 14:16:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4467D383E820 Received: by mail-wm1-x331.google.com with SMTP id i20-20020a05600c355400b0039456976dcaso3615731wmq.1 for ; Thu, 19 May 2022 07:16:21 -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=Lkd22x6EnS3eW23vEJ51h1mO3ELm/EXBMUTVnYuy5MI=; b=zioNsXKx07CUQosJNX3QWY0bljiQKlvtqzWpRbx7SAAETmaEbRdev9Rq7qNFxnPXRR DQlDKhiDKXkjH9i/pEk+N/HFa8wP9puM/NqCfml5cf1XVNDRwwBRuvCc9QCvzPfxWB11 4iGea0Mvrl+LktZz6wbsXJKpYT8JH6MOc2+XX2GaD8XqdGBxTcwIf8MisZpcvjyUHNak JxQYbpnJyOiilTwE0PdWOz7ZvtCO8vb6PXaGXw/bEHoDJvpLVatLzsPeWHAlz8vha3Kj UQPyOk7XyMtOmVPLNUljuesUtYvTj3ptDyc4eSTpVrvSq8LwyVzMNl731c+wHLbVw0S3 osSQ== X-Gm-Message-State: AOAM5300G21GiYh15DFvFu5tyKCNkXzjghUdUY3DchaVUluc6hvRlht0 CEeyssVDYQkpsliJfABRRdQKKWdWXsK6qA== X-Google-Smtp-Source: ABdhPJzKs4LvI4lRTph7J3RfWSwQZXBckzZaf7OKlEXaQQffjd9sxy42apMpQRI5ezXpjoEOrd2Vcw== X-Received: by 2002:a05:600c:1d08:b0:394:54ee:c994 with SMTP id l8-20020a05600c1d0800b0039454eec994mr4004060wms.137.1652969780671; Thu, 19 May 2022 07:16:20 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id o16-20020a05600c511000b003942a244ec8sm4742486wms.13.2022.05.19.07.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 07:16:20 -0700 (PDT) Date: Thu, 19 May 2022 14:16:19 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Remove redundant marking of illegal pragma with error posted Message-ID: <20220519141619.GA3723455@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: Piotr Trojanek Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" We flag illegal pragma Elaborate with a call to Error_Msg on the pragma argument, which in turn calls Set_Error_Posted on the enclosing statement, i.e. on the pragma itself. The explicit call to Set_Error_Posted on the pragma itself was redundant. Cleanup related to handling of illegal code when detecting uninitialized scalar objects. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_prag.adb (Analyze_Pragma): Remove redundant call to Set_Error_Posted. diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -16008,7 +16008,6 @@ package body Sem_Prag is end loop Innr; if Citem = N then - Set_Error_Posted (N); Error_Pragma_Arg ("argument of pragma% is not withed unit", Arg); end if;