From patchwork Wed Sep 26 09:25:38 2018 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: 974944 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-486423-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="h2mteKdv"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42Kszw68C0z9s55 for ; Wed, 26 Sep 2018 19:27:56 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=YDB3Oc3KwAhYYI1glm5zhTCIvLaT9djLHJYHudIzGuMdykGBsz OTdI83Tanl9O8AHR/oucOeGBSeaCB3Sx4FQiEGf2liHZ9LvrKHjEnMzVbSjO/GUB QZUQ5VjY7qRFwIXqPE4DLuoyadGmOag9tekAdqY0qxPdC/ZFTRXntbgJ0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=vSawpWdfkYVjDEiTxNx9uXzJW4I=; b=h2mteKdv3Jw6gYnLm7aA Ye/mX35PO1z44On0hruBrppiz+zPNXCaMYhQ9l/A0VidSUnUs24UJDcAIpuya7Cx Oq3KsO+3bQHRIrOG3g5rwaaUFWn7jgNsP7Bfz1X5uj6vaj+TJqby1b8dQSCG819l /PRteEmRqecILl1qLND9NNk= Received: (qmail 87223 invoked by alias); 26 Sep 2018 09:25:43 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 87058 invoked by uid 89); 26 Sep 2018 09:25:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Sep 2018 09:25:41 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4BE26117D36; Wed, 26 Sep 2018 05:25:38 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id aiIcdvQLgOsN; Wed, 26 Sep 2018 05:25:38 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id 3AD5F117182; Wed, 26 Sep 2018 05:25:38 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4862) id 39B6A3499; Wed, 26 Sep 2018 05:25:38 -0400 (EDT) Date: Wed, 26 Sep 2018 05:25:38 -0400 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [Ada] Do not issue by default info messages for inlining in GNATprove Message-ID: <20180926092538.GA126159@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Info messages about lack of inlining for analysis in GNATprove may be confusing to users. They are now only issued when GNATprove is called with switch --info, which it passes on to gnat2why with switch -gnatd_f. There is no effect on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-09-26 Yannick Moy gcc/ada/ * debug.adb: Add use for -gnatd_f switch. * inline.adb (Cannot_Inline): Only issue info message for failure to inline in GNATprove mode when switch -gnatd_f is used. --- gcc/ada/debug.adb +++ gcc/ada/debug.adb @@ -150,7 +150,7 @@ package body Debug is -- d_c -- d_d -- d_e Ignore entry calls and requeue statements for elaboration - -- d_f + -- d_f Issue info messages related to GNATprove usage -- d_g -- d_h -- d_i Ignore activations and calls to instances for elaboration @@ -831,6 +831,11 @@ package body Debug is -- control, conditional entry calls, timed entry calls, and requeue -- statements in both the static and dynamic elaboration models. + -- d_f Issue info messages related to GNATprove usage to help users + -- understand analysis results. By default these are not issued as + -- beginners find them confusing. Set automatically by GNATprove when + -- switch --info is used. + -- d_i The compiler ignores calls and task activations when they target a -- subprogram or task type defined in an external instance for both -- the static and dynamic elaboration models. --- gcc/ada/inline.adb +++ gcc/ada/inline.adb @@ -1607,13 +1607,16 @@ package body Inline is then null; - -- In GNATprove mode, issue a warning, and indicate that the - -- subprogram is not always inlined by setting flag Is_Inlined_Always - -- to False. + -- In GNATprove mode, issue a warning when -gnatd_f is set, and + -- indicate that the subprogram is not always inlined by setting + -- flag Is_Inlined_Always to False. elsif GNATprove_Mode then Set_Is_Inlined_Always (Subp, False); - Error_Msg_NE (Msg & "p?", N, Subp); + + if Debug_Flag_Underscore_F then + Error_Msg_NE (Msg & "p?", N, Subp); + end if; elsif Has_Pragma_Inline_Always (Subp) then @@ -1634,12 +1637,16 @@ package body Inline is Error_Msg_NE (Msg (Msg'First .. Msg'Last - 1), N, Subp); - -- In GNATprove mode, issue a warning, and indicate that the subprogram - -- is not always inlined by setting flag Is_Inlined_Always to False. + -- In GNATprove mode, issue a warning when -gnatd_f is set, and + -- indicate that the subprogram is not always inlined by setting + -- flag Is_Inlined_Always to False. elsif GNATprove_Mode then Set_Is_Inlined_Always (Subp, False); - Error_Msg_NE (Msg & "p?", N, Subp); + + if Debug_Flag_Underscore_F then + Error_Msg_NE (Msg & "p?", N, Subp); + end if; else