|
|
When compiling h.ads, the global variable Global and function Subroutine should
be eliminated. They are not, because they have TREE_PUBLIC set (corresponds to
Is_Public in the Ada f-e) even though they are internal to the body of the
generic package G. This seems to be because G is instantiated in a package
spec.
The result is that Global and Subroutine are marked as external symbols.
Reproduce as follows: gcc -S -O1 h.ads -o - | grep h__gi__
There should be no output.
-- testcase --
generic package G is
pragma Elaborate_Body;
end;
package body G is
Global : Integer;
procedure Subroutine is begin null; end;
end;
with G;
package H is
package GI is new G;
end;
--
Summary: Globals and functions private to generic body exported
when instantiated in a spec
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: baldrick at gcc dot gnu dot org
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37796
|
|