public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/48013] New: generic instantiation breaks the restriction of No_Elaboration_Code
@ 2011-03-07  8:27 demoonlit at panathenaia dot halfmoon.jp
  2014-11-10 12:50 ` [Bug ada/48013] " fxcoudert at gcc dot gnu.org
  2015-09-01 23:25 ` demoonlit at panathenaia dot halfmoon.jp
  0 siblings, 2 replies; 3+ messages in thread
From: demoonlit at panathenaia dot halfmoon.jp @ 2011-03-07  8:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48013

           Summary: generic instantiation breaks the restriction of
                    No_Elaboration_Code
           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 23565
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23565
minimal bug triggering source code

Unnecessary elaboration code is generated by generic instantiation
with gcc-4.5.1/4.5.2/4.6.0(experimental at 20110225).

1. instantiate any generic package/subprogram in the library-level package.
2. gnatbind an application including this package.

pragma Restrictions (No_Elaboration_Code) and pragma No_Run_Time are not
effective in this problem.
I expected that elaboration code will be removed or reported warning/error by
Restrictions (No_Elaboration_Code).

-- t_m.adb

pragma Restrictions (No_Elaboration_Code);
pragma No_Run_Time;
with t_i;
procedure t_m is
begin
   null;
end t_m;

-- t_g.ads

pragma Restrictions (No_Elaboration_Code);
pragma No_Run_Time;
generic
procedure t_g;
pragma Pure (t_g);

-- t_g.adb

pragma Restrictions (No_Elaboration_Code);
pragma No_Run_Time;
procedure t_g is
begin
   null;
end t_g;

-- t_i.adb

pragma Restrictions (No_Elaboration_Code);
pragma No_Run_Time;
with t_g;
package t_i is
   pragma Pure (t_i);
   procedure nested is new t_g; -- *1
end t_i;

% gnatmake -g t_m 
gcc -c -g t_m.adb 
gcc -c -g t_i.ads 
gcc -c -g t_g.adb 
gnatbind -x t_m.ali 
gnatlink t_m.ali -g 

Look adainit in b~t_m.adb.

   procedure adainit is 
      E2 : Boolean; pragma Import (Ada, E2, "t_i_E"); 
   begin 
      null; 
      t_i'elab_spec; -- it violates No_Elaboration_Code !
      E2 := True; 
   end adainit; 

% nm t_i.o 
00000261 D _t_i_E 
00000008 T _t_i___elabs
00000000 T _t_i__nested 

(Remove generic instantiation (*1), and re-compile these, 
then, elaboration code disappeared from adainit in b~t_m.adb
and __elabs procedure disappeared from t_i.o too.)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/48013] generic instantiation breaks the restriction of No_Elaboration_Code
  2011-03-07  8:27 [Bug ada/48013] New: generic instantiation breaks the restriction of No_Elaboration_Code demoonlit at panathenaia dot halfmoon.jp
@ 2014-11-10 12:50 ` fxcoudert at gcc dot gnu.org
  2015-09-01 23:25 ` demoonlit at panathenaia dot halfmoon.jp
  1 sibling, 0 replies; 3+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-10 12:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48013

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|i686-apple-darwin9          |
               Host|i686-apple-darwin9          |
              Build|i686-apple-darwin9          |

--- Comment #1 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Confirmed with trunk on x86_64-linux.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/48013] generic instantiation breaks the restriction of No_Elaboration_Code
  2011-03-07  8:27 [Bug ada/48013] New: generic instantiation breaks the restriction of No_Elaboration_Code demoonlit at panathenaia dot halfmoon.jp
  2014-11-10 12:50 ` [Bug ada/48013] " fxcoudert at gcc dot gnu.org
@ 2015-09-01 23:25 ` demoonlit at panathenaia dot halfmoon.jp
  1 sibling, 0 replies; 3+ messages in thread
From: demoonlit at panathenaia dot halfmoon.jp @ 2015-09-01 23:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48013

yuta tomino <demoonlit at panathenaia dot halfmoon.jp> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|4.5.2                       |6.0
      Known to fail|                            |4.5.2

--- Comment #2 from yuta tomino <demoonlit at panathenaia dot halfmoon.jp> ---
It has appeared on 6.0.0-20150823.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-01 23:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07  8:27 [Bug ada/48013] New: generic instantiation breaks the restriction of No_Elaboration_Code demoonlit at panathenaia dot halfmoon.jp
2014-11-10 12:50 ` [Bug ada/48013] " fxcoudert at gcc dot gnu.org
2015-09-01 23:25 ` demoonlit at panathenaia dot halfmoon.jp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).