From patchwork Thu Sep 7 09:33:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 810939 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-461668-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="AkKBDVQM"; 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 3xnwJf65YMz9sNV for ; Thu, 7 Sep 2017 19:34:26 +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=Mw1oJ7OL+QUiouG07+myaLaxRT28sMLptYpUUuh3PYoc9AxGGT TqwGpYMxpdpQnHqS5YUuIQtYMhJZ0Kjj0rVQNH7NPdmqdubImneBlistYR04bwG5 maINz9xSwltv9ouieR1Wd5IwXaaBCMCBhW2ksHecldWdOj79dGhMb4Ih0= 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=QhHmQqL5mIKTdP2sUGyv6QJYR78=; b=AkKBDVQMizY8o83ujC7t Ap/baoz7bkSVKzL918eA7pfl32r6egpIvXebH7DUD7pWKhbxi1RyogtSnu26szJZ tfH2bgUF6wUdfokXUaYsaTQBbnFuWGHqOeMXjkRlI9DLhRvD33vVluKsONrXaRU8 3DYORFauRvHlHqC4DkRIblY= Received: (qmail 90150 invoked by alias); 7 Sep 2017 09:33:53 -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 89962 invoked by uid 89); 7 Sep 2017 09:33:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.2 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=ts 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; Thu, 07 Sep 2017 09:33:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AE445561AA; Thu, 7 Sep 2017 05:33:49 -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 IDNAq7gOxrWp; Thu, 7 Sep 2017 05:33:49 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id 9E70E561A2; Thu, 7 Sep 2017 05:33:49 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4192) id 9BC534FC; Thu, 7 Sep 2017 05:33:49 -0400 (EDT) Date: Thu, 7 Sep 2017 05:33:49 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [Ada] Fix internal error on task allocation and inlining Message-ID: <20170907093349.GA75070@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) This fixes a small regression introduced by the recent improvement to the algorithm used by Hide_Public_Entities to compute the final set of external visible entities of a package. It now needs to recurse on the Actions list of freeze nodes to find references to subprograms. The following procedure must compile quietly with -O -gnatn: with T; procedure P is begin T.S; end; package T is procedure S with Inline; end; package body T is task type TT; task body TT is begin null; end; type TTA is access TT; X : TTA; procedure S is begin X := new TT; end; Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-07 Eric Botcazou * sem_ch7.adb (Has_Referencer): Recurse on Actions of freeze nodes. Index: sem_ch7.adb =================================================================== --- sem_ch7.adb (revision 251785) +++ sem_ch7.adb (working copy) @@ -402,6 +402,18 @@ end if; end if; + -- Freeze node + + elsif Nkind (Decl) = N_Freeze_Entity then + declare + Discard : Boolean; + pragma Unreferenced (Discard); + begin + -- Inspect the actions to find references to subprograms + + Discard := Has_Referencer (Actions (Decl)); + end; + -- Exceptions, objects and renamings do not need to be public -- if they are not followed by a construct which can reference -- and export them. The Is_Public flag is reset on top level @@ -484,7 +496,7 @@ -- Local variables - Discard : Boolean := True; + Discard : Boolean; pragma Unreferenced (Discard); -- Start of processing for Hide_Public_Entities