From patchwork Tue May 23 08:07:47 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: 1784947 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=X3tCEF79; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QQRqX1mWWz2020 for ; Tue, 23 May 2023 18:11:52 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 41A87382CD7A for ; Tue, 23 May 2023 08:11:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41A87382CD7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684829510; bh=Fo8D6tJ7Ki82gSnXwZ6LR8u55ubkgs6XbnIr8/f3c+Q=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=X3tCEF797OtiJktSH74Rl3S6CP2p1+QYAD9wHtJsy22bFgMZA4KTGrifQzNt9xcN+ edu8J12CokxJEtkHQbtCSvABp8C6qXQFDJohplSYgMXzOq25APTjC2cqmb/34kUfTx 6PB6jbxOKpAlfs/8gxpkI2rahnB0tM/YLQHDNDjs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 6C03A3856DF2 for ; Tue, 23 May 2023 08:07:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6C03A3856DF2 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-309550d4f73so3034139f8f.1 for ; Tue, 23 May 2023 01:07:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684829268; x=1687421268; 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=Fo8D6tJ7Ki82gSnXwZ6LR8u55ubkgs6XbnIr8/f3c+Q=; b=U6roBcmwftHt1nIr2szQbXmbVgMaUqzmmcDIc3U3/OXT8aAhfzZQRNbXVMRr0VTFlC tn9lzUYEr4CCwChd5KKlt0uhZsQz+j06sMmf31ufW9NWQyy8BMODCWTHZk3avS2j5VOg 9PEqfs8wZCMyCvPHCrUeRClQcAyCUqvRQ5T/Pml3SGH1N/xVlyiK+lcokI/Ls7CIMl7Q nAw/lmly+2HXm7e9YwTK3q9S3DC3M/PUwDtu0saF1wLoaD8VUmrwc/Jq1l6SyJef1r+z vha9xn65iAiluV4YalAaOjUC1ovj+BJP256wfCqlckuEsjutdC8fCUgme+i4/OokNCXf lj5g== X-Gm-Message-State: AC+VfDyBMK7/GBgubDrhP0LVhekngG0CTQRFRa9XLP2p+CpF0zPpQkZn S/HBqzqru8vNBoSGMwI+NzH4PJ1c7yUDAHewfWxO5w== X-Google-Smtp-Source: ACHHUZ7wHmoFzdBtSqnikNMfHHbCiicDPO7a3wPRKwr59iXMhaNrMILw3zEqqV5BYaFbRg/MxhFG1A== X-Received: by 2002:adf:d0d1:0:b0:307:7d12:9bc9 with SMTP id z17-20020adfd0d1000000b003077d129bc9mr12024318wrh.21.1684829268269; Tue, 23 May 2023 01:07:48 -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 c10-20020a5d414a000000b00304ae802f02sm10171881wrq.66.2023.05.23.01.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 01:07:47 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Suppress warning about Subprogram_Variant failing at run time Date: Tue, 23 May 2023 10:07:47 +0200 Message-Id: <20230523080747.1872885-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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" From: Piotr Trojanek Warning about check failing at run time is likely spurious for mutually recursive subprograms with multiple variant clauses. These will be non-trivial to detect, so we simply suppress the warning altogether for all subprogram variants. gcc/ada/ * exp_prag.adb (Expand_Pragma_Check): Suppress warning for checks of subprogram variants. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_prag.adb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index ceb27848dad..c6b3bed5425 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -564,6 +564,13 @@ package body Exp_Prag is then null; + -- For Subprogram_Variant suppress the warning altogether, because + -- for mutually recursive subprograms with multiple variant clauses + -- some of the clauses might have expressions that are only meant for + -- verification and would always fail when executed. + + elsif Nam = Name_Subprogram_Variant then + null; elsif Nam = Name_Assert then Error_Msg_N ("?.a?assertion will fail at run time", N); else