decl.c (gnat_to_gnu_entity): Deal with an error mark as renamed object in type annotating mode.

* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Deal with an
	error mark as renamed object in type annotating mode.

From-SVN: r204942
This commit is contained in:
Eric Botcazou 2013-11-18 09:50:25 +00:00 committed by Eric Botcazou
parent 5f1b2f8bfb
commit 9adcf5b40a
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2013-11-18 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Deal with an
error mark as renamed object in type annotating mode.
2013-11-15 H.J. Lu <hongjiu.lu@intel.com>
PR ada/54040

View file

@ -1117,8 +1117,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
as we have a VAR_DECL for the pointer we make. */
}
gnu_expr = build_unary_op (ADDR_EXPR, gnu_type,
maybe_stable_expr);
if (type_annotate_only
&& TREE_CODE (maybe_stable_expr) == ERROR_MARK)
gnu_expr = NULL_TREE;
else
gnu_expr = build_unary_op (ADDR_EXPR, gnu_type,
maybe_stable_expr);
gnu_size = NULL_TREE;
used_by_ref = true;