decl.c (gnat_to_gnu_entity): If there is an alignment set on a renaming...

* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: If there is an
	alignment set on a renaming, assert that the renamed object is aligned
	enough as to make it possible to honor it.

From-SVN: r182201
This commit is contained in:
Eric Botcazou 2011-12-11 10:40:08 +00:00 committed by Eric Botcazou
parent 5d74133f84
commit 50751f49cc
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2011-12-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: If there is an
alignment set on a renaming, assert that the renamed object is aligned
enough as to make it possible to honor it.
2011-12-11 Eric Botcazou <ebotcazou@adacore.com> 2011-12-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (gigi): Initialize the linemap earlier. * gcc-interface/trans.c (gigi): Initialize the linemap earlier.

View File

@ -1008,6 +1008,17 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
saved = true; saved = true;
annotate_object (gnat_entity, gnu_type, NULL_TREE, annotate_object (gnat_entity, gnu_type, NULL_TREE,
false, false); false, false);
/* This assertion will fail if the renamed object
isn't aligned enough as to make it possible to
honor the alignment set on the renaming. */
if (align)
{
unsigned int renamed_align
= DECL_P (gnu_decl)
? DECL_ALIGN (gnu_decl)
: TYPE_ALIGN (TREE_TYPE (gnu_decl));
gcc_assert (renamed_align >= align);
}
break; break;
} }