diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-29 17:45:34 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-29 17:45:34 +0000 |
commit | 0617d4e0de77a17d367b936035cc801e1f2c17f0 (patch) | |
tree | 35b3840e2994d048f7e161ff88c943ccadca7a03 /gcc/ada/gcc-interface/utils.c | |
parent | 602bd329fa132b6caa9a9fc41f53cb30d62b316e (diff) |
PR ada/63310
* gcc-interface/utils.c (gnat_write_global_declarations): Always
build the dummy global variable if code was generated.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225139 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 16 |
1 files changed, 9 insertions, 7 deletions
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 |