User account creation filtered due to spam.

Bug 65683 - [5/6/7/8 regression] access types across "limited with" breaks restriction of No_Elaboration_Code
Summary: [5/6/7/8 regression] access types across "limited with" breaks restriction of...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 5.0
: P4 normal
Target Milestone: 5.5
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-07 11:00 UTC by yuta tomino
Modified: 2016-06-03 10:07 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.9.2
Known to fail: 5.0
Last reconfirmed: 2015-12-06 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yuta tomino 2015-04-07 11:00:41 UTC
package pkg_a is
   type T is null record; -- non-controlled type
end pkg_a;

pragma Restrictions (No_Elaboration_Code);
limited with pkg_a;
package pkg_b is
   type P is access all pkg_a.T;
   for P'Storage_Size use 0;
end pkg_b;

Compile it with gcc-4.9.2.

  % gcc -c pkg_b.ads
  (success with no messages)

Compile it with gcc-5-20150405.

  % gcc -c pkg_b.ads
  pkg_b.ads:5:09: violation of restriction "no_elaboration_code" at line 2

See pkg_b.ads.dg by -gnatD, the unnecessary master is generated.

pragma restrictions (no_elaboration_code);
limited with pkg_a;
with system.system__soft_links;
with system.system__tasking;

package pkg_b is
   pkg_b___master : constant system__tasking__master_id :=
     system__soft_links__current_master.all;
   pkg_b__pM : system__tasking__master_id renames pkg_b___master;
   type pkg_b__p is access all pkg_a.t;
   for pkg_b__p'storage_size use 0;
   freeze pkg_b__p []
end pkg_b;

[subtype T1s is String (1 .. 73);]
freeze_generic T1s
freeze_generic object_pointer

This master has not appeared until gcc-4.9.
And, if "limited" is removed, it disappears with gcc-5-20150405.
Comment 1 Jakub Jelinek 2015-04-22 11:59:39 UTC
GCC 5.1 has been released.
Comment 2 Richard Biener 2015-07-16 09:14:01 UTC
GCC 5.2 is being released, adjusting target milestone to 5.3.
Comment 3 Richard Biener 2015-12-04 10:47:23 UTC
GCC 5.3 is being released, adjusting target milestone.
Comment 4 Eric Botcazou 2015-12-06 20:14:45 UTC
Still fails on mainline.
Comment 5 Richard Biener 2016-06-03 10:07:15 UTC
GCC 5.4 is being released, adjusting target milestone.