From 4453a8221c65f386ae361670fa932643521374d7 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 26 Sep 2018 09:17:10 +0000 Subject: [PATCH] [Ada] ICE on array of task type with -gnatct 2018-09-26 Eric Botcazou gcc/ada/ * gcc-interface/decl.c (gnat_to_gnu_entity) : In -gnatct mode, process the discriminants only for a definition. From-SVN: r264610 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/decl.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 83685b4d077..a0252f8d1af 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity) : In + -gnatct mode, process the discriminants only for a definition. + 2018-09-26 Eric Botcazou * repinfo.adb (List_Record_Layout): Be prepared for JSON output. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index c15b0c8ef2e..8dd62f73d5e 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -4158,7 +4158,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) part of the associated body so they need to be translated. */ if (type_annotate_only && gnat_equiv_type == gnat_entity) { - if (Has_Discriminants (gnat_entity) + if (definition + && Has_Discriminants (gnat_entity) && Root_Type (gnat_entity) == gnat_entity) { tree gnu_field_list = NULL_TREE; -- 2.30.2