From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15629 invoked by alias); 7 Mar 2011 07:47:16 -0000 Received: (qmail 15618 invoked by uid 22791); 7 Mar 2011 07:47:15 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Mar 2011 07:47:09 +0000 From: "demoonlit at panathenaia dot halfmoon.jp" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/48012] New: The executable file hangs up by combination of controlled-type, generic, renames and Inline_Always X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: demoonlit at panathenaia dot halfmoon.jp X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 07 Mar 2011 07:47:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg00565.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48012 Summary: The executable file hangs up by combination of controlled-type, generic, renames and Inline_Always Product: gcc Version: 4.5.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada AssignedTo: unassigned@gcc.gnu.org ReportedBy: demoonlit@panathenaia.halfmoon.jp Created attachment 23564 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23564 minimal bug triggering source code My application hangs up conpilied with gcc-4.5.2. 1. declare a controlled-type (named T) as private. 2. declare a generic function (named G) return T. 3. instantiate G. 4. declare a function (named F) renames it, and write pramga Inline_Always. 5. call F, it may hang up! Probably, an object of T is attached to a finalization list, twice. -- iacm.adb with iact; with iacp; procedure iacm is X : iact.T := iacp.F; -- hang up !! begin null; end iacm; -- iact.ads with Ada.Finalization; package iact is type T is private; -- hidden controll type generic function G return T; private type T is new Ada.Finalization.Controlled with null record; end iact; -- iact.adb package body iact is function G return T is begin return (Ada.Finalization.Controlled with null record); end G; end iact; -- iacp.ads with iact; package iacp is function F return iact.T; pragma Inline_Always (F); -- this pragma causes hang up private function G is new iact.G; function F return iact.T renames G; end iacp; % gnatmake iacm gcc -c iacm.adb gcc -c iacp.ads gcc -c iact.adb gnatbind -x iacm.ali gnatlink iacm.ali % ./iacm ( hang up !! )