From patchwork Tue Oct 20 09:48:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 532865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 46A161402B2 for ; Tue, 20 Oct 2015 20:48:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=P4rXgIqM; dkim-atps=neutral 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=eVnR1v03R/RGYAsZETp5WcaxkGbb7n5nlm6xjX2y0JbSHSNC5F JnjRRldae0ysUgAZbCKwWKPiOG2CQh7f9EXkM+CNarXrIXP/BZ+jFuy5fQPpRk6k 30DFsUjrvq1YJQ8HXc0gRutSmo0SADhZQRViDTPGGdx52oL5fKEcUuup4= 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=zTJFTzxcWCvBSaRn9iUI5Mcv2q4=; b=P4rXgIqMiUPo8C/8cDkU Z8HDj+EfGQEALI759HEXpbmcDkapH7REbm8uoxhMJSwymPqIv86qeBSVYw5ztmUZ kwp9h1zUzC22Gd54V4+3MUByNwodozQ2qZMl2i7IoDII5ZKtNj6BAZYa0B2944Kj 42+ev27DhvszpV3cKGz9rqQ= Received: (qmail 20502 invoked by alias); 20 Oct 2015 09:48:28 -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 20092 invoked by uid 89); 20 Oct 2015 09:48:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=BAYES_05, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 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 (AES256-SHA encrypted) ESMTPS; Tue, 20 Oct 2015 09:48:21 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0CD20297AB; Tue, 20 Oct 2015 05:48:20 -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 NF0easPCTC41; Tue, 20 Oct 2015 05:48:19 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id F0B0E28F8A; Tue, 20 Oct 2015 05:48:19 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4192) id EFA883CD; Tue, 20 Oct 2015 05:48:19 -0400 (EDT) Date: Tue, 20 Oct 2015 05:48:19 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Yannick Moy Subject: [Ada] Do not inline No_Return procedures in GNATprove mode Message-ID: <20151020094819.GA130987@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Inlining in GNATprove mode is made to improve results of formal verification in GNATprove. It should not be done on procedures marked No_Return, which are handled specially in GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-20 Yannick Moy * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Return False for procedures marked No_Return. * sem_util.ads (Enclosing_Declaration): Improve comment. Index: inline.adb =================================================================== --- inline.adb (revision 229023) +++ inline.adb (working copy) @@ -1534,6 +1534,12 @@ elsif In_Package_Visible_Spec (Id) then return False; + -- Do not inline subprograms marked No_Return, possibly used for + -- signaling errors, which GNATprove handles specially. + + elsif No_Return (Id) then + return False; + -- Do not inline subprograms that have a contract on the spec or the -- body. Use the contract(s) instead in GNATprove. Index: sem_util.ads =================================================================== --- sem_util.ads (revision 229023) +++ sem_util.ads (working copy) @@ -532,7 +532,8 @@ -- Returns the closest ancestor of Typ that is a CPP type. function Enclosing_Declaration (N : Node_Id) return Node_Id; - -- Returns the declaration node enclosing N, if any, or Empty otherwise + -- Returns the declaration node enclosing N (including possibly N itself), + -- if any, or Empty otherwise function Enclosing_Generic_Body (N : Node_Id) return Node_Id;