This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Internal error on renaming of constant array with -gnatc
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 18 Nov 2013 10:48:44 +0100
- Subject: [Ada] Internal error on renaming of constant array with -gnatc
- Authentication-results: sourceware.org; auth=none
This fixes an ICE on an obscure case with the -gnatc switch.
Tested on x86_64-suse-linux, applied on the mainline.
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.
--
Eric Botcazou
Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c (revision 204913)
+++ gcc-interface/decl.c (working copy)
@@ -1117,8 +1117,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
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;