Commit 8c41a1c8 by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): If the record has a parent field and a representation clause...

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: If the
	record has a parent field and a representation clause, make sure that
	it is properly aligned.

From-SVN: r223915
parent 44eff886
2015-06-01 Eric Botcazou <ebotcazou@adacore.com> 2015-06-01 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: If the
record has a parent field and a representation clause, make sure that
it is properly aligned.
2015-06-01 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (lvalue_required_p) <N_Indexed_Component>: Deal * gcc-interface/trans.c (lvalue_required_p) <N_Indexed_Component>: Deal
with character and enumeration literals as index values. with character and enumeration literals as index values.
......
...@@ -3019,6 +3019,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -3019,6 +3019,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
else else
gnu_parent = gnat_to_gnu_type (gnat_parent); gnu_parent = gnat_to_gnu_type (gnat_parent);
/* The parent field needs strict alignment so, if it is to
be created with a component clause below, then we need
to apply the same adjustment as in gnat_to_gnu_field. */
if (has_rep && TYPE_ALIGN (gnu_type) < TYPE_ALIGN (gnu_parent))
TYPE_ALIGN (gnu_type) = TYPE_ALIGN (gnu_parent);
/* Finally we fix up both kinds of twisted COMPONENT_REF we have /* Finally we fix up both kinds of twisted COMPONENT_REF we have
initially built. The discriminants must reference the fields initially built. The discriminants must reference the fields
of the parent subtype and not those of its base type for the of the parent subtype and not those of its base type for the
......
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