From: Eric Botcazou Date: Mon, 29 Jun 2015 17:45:34 +0000 (+0000) Subject: re PR ada/63310 (Ada bootstrap error with -fcompare-debug) X-Git-Tag: basepoints/gcc-7~6012 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=755c71faf3932e6febceb1dca4fbd448a00cc427;p=thirdparty%2Fgcc.git re PR ada/63310 (Ada bootstrap error with -fcompare-debug) PR ada/63310 * gcc-interface/utils.c (gnat_write_global_declarations): Always build the dummy global variable if code was generated. From-SVN: r225139 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 97e293dec128..db7942043306 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2015-06-29 Eric Botcazou + + PR ada/63310 + * gcc-interface/utils.c (gnat_write_global_declarations): Always + build the dummy global variable if code was generated. + 2015-06-29 Manuel López-Ibáñez PR fortran/66605 diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index ab5b9e0bc45f..a02dc67a3054 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -5202,8 +5202,9 @@ gnat_write_global_declarations (void) tree iter; /* If we have declared types as used at the global level, insert them in - the global hash table. We use a dummy variable for this purpose. */ - if (types_used_by_cur_var_decl && !types_used_by_cur_var_decl->is_empty ()) + the global hash table. We use a dummy variable for this purpose, but + we need to build it unconditionally to avoid -fcompare-debug issues. */ + if (first_global_object_name) { struct varpool_node *node; char *label; @@ -5218,11 +5219,12 @@ gnat_write_global_declarations (void) node->definition = 1; node->force_output = 1; - while (!types_used_by_cur_var_decl->is_empty ()) - { - tree t = types_used_by_cur_var_decl->pop (); - types_used_by_var_decl_insert (t, dummy_global); - } + if (types_used_by_cur_var_decl) + while (!types_used_by_cur_var_decl->is_empty ()) + { + tree t = types_used_by_cur_var_decl->pop (); + types_used_by_var_decl_insert (t, dummy_global); + } } /* Output debug information for all global type declarations first. This