Commit 8c44fc0f by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Apply special treatment of derived packed array…

decl.c (gnat_to_gnu_entity): Apply special treatment of derived packed array types to constrained subtypes only.

	* gcc-interface/decl.c (gnat_to_gnu_entity): Apply special treatment
	of derived packed array types to constrained subtypes only.

From-SVN: r216727
parent 33ccc536
2014-10-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): Apply special treatment
of derived packed array types to constrained subtypes only.
2014-10-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Remove
superfluous computation for the max size.
<E_Array_Subtype>: Likewise. Make sure that the max size calculation
......
......@@ -5083,8 +5083,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (Is_Derived_Type (gnat_entity) && !type_annotate_only)
{
Entity_Id gnat_parent_type = Underlying_Type (Etype (gnat_entity));
/* For packed array subtypes, the implementation type is used. */
/* For constrained packed array subtypes, the implementation type is
used instead of the nominal type. */
if (kind == E_Array_Subtype
&& Is_Constrained (gnat_entity)
&& Present (Packed_Array_Impl_Type (gnat_parent_type)))
gnat_parent_type = Packed_Array_Impl_Type (gnat_parent_type);
relate_alias_sets (gnu_type, gnat_to_gnu_type (gnat_parent_type),
......
2014-10-27 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/pack10.ads: New test.
* gnat.dg/specs/pack10_pkg.ad[sb]: New helper.
2014-10-27 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/entry_queues2.adb: New test.
2014-10-25 Jakub Jelinek <jakub@redhat.com>
......
-- { dg-do compile }
with Pack10_Pkg; use Pack10_Pkg;
package Pack10 is
type Boolean_Vector is array (Positive range <>) of Boolean;
type Packed_Boolean_Vector is new Boolean_Vector;
pragma Pack (Packed_Boolean_Vector);
procedure My_Proc is new Proc (Packed_Boolean_Vector);
end Pack10;
package body Pack10_Pkg is
procedure Proc is begin null; end;
end Pack10_Pkg;
-- { dg-excess-errors "cannot generate code" }
package Pack10_Pkg is
generic
type Vector_Type (<>) is private;
procedure Proc;
end Pack10_Pkg;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment