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: 97863 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1976480vqo; Tue, 23 May 2023 01:17:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5pZlyuwn/HMBHDkQeqbt78PJ0KsMNAm9teHPqyGIL8Ki+qkOpehKyJGVmHLfpOw9t06v4b X-Received: by 2002:a50:ed09:0:b0:50c:161b:9154 with SMTP id j9-20020a50ed09000000b0050c161b9154mr12208002eds.11.1684829856884; Tue, 23 May 2023 01:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684829856; cv=none; d=google.com; s=arc-20160816; b=1Ft8r8+vnBZnLmF6XIZvnSzv7Y20zkog9wQyZF64pJR9z+JYRrnWbxjt/bhhbIqlBj jAetPYp6V1cBZdXiwbpDiWiZfjl1/Gb9iIDYZb11K2HOtNW/Zt1j6F47Wfh3mrJW3766 qyljyrVZbB9AhmlDBO5pwUMQmoRaR/RjO56iEuy7MD87i2eZleDAqblCSqho+TEnLmZH lWSClmK+4gZuXHR4DwHvF1DkYFoFHPxFJgbkKKF9h3u+TkDQVpSdxmQl6YnQZY4uiPmn a/LbRF0PXksx2eA9ED72/d47HnRkl5dBoRVGeaWxeUdPMGCsujQDmVb6KqHKnmQaEuOl +4tw== 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=Fo8D6tJ7Ki82gSnXwZ6LR8u55ubkgs6XbnIr8/f3c+Q=; b=FabmvyyeXZg4Bjvfl39pgERxQQhisNHq7Q5GnwBJi2L8uNnaXLoWB/+VNFPIlesBxB Fx2avVAJcl71dja9b3cSGw6/pp5eklKis5C/FMLm7mp+omlbOZDCSRo1sYVbSbDmgs/g 3IEYBMH2+ds9NTQaTRc0JjU/gx9nhNNX/4wZ22OtPNrpiliK1B7BRHiqQY7ce/mu/Rd8 Pw+ktJZ14D4jjyxY0EnyfoAC0F8+u8gc4WNX6Mfj8ZrsohKorFdvrBeMfJv2MRS7LS4/ J9ICE4LB2SucJYAi2IoWygGAEuu2c47z3+AWfW1nzOhuB7FqZCNeJQ9wlqbk9KjiRp9Z luZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=wrnFqDKR; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y14-20020aa7c24e000000b0050dfe0d8750si383924edo.632.2023.05.23.01.17.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 01:17:36 -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=wrnFqDKR; 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 564193948A78 for ; Tue, 23 May 2023 08:12:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 564193948A78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684829537; 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=wrnFqDKRVrPvc6kX+1YOEEgNBFebQXzJzncHn3WrCuVqWWZe4cd3OHdUhxC0eyVC4 ajlNPBqdsop/ma7kqHtBr2hcq+tmFDu3m38802y/WwPyD59yED1Ei1GJZe6OJURA9m J96dnQS/qD6cgZ+h0YC6DSEcBHt0WCf44DJK2ivI= 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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766672152353517786?= X-GMAIL-MSGID: =?utf-8?q?1766672152353517786?= 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