summaryrefslogtreecommitdiffstats
path: root/gcc/ada
diff options
context:
space:
mode:
authorgrahams <grahams@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-05 00:49:44 +0000
committergrahams <grahams@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-05 00:49:44 +0000
commitefa9ae36f3c2bce7410616f921298a2014763f0e (patch)
tree2981b2159d5f511e06d96effea4338f68a4b6cea /gcc/ada
parentb19cad40b13c57520def9623ef5c5d7948fe957a (diff)
downloadppe42-gcc-efa9ae36f3c2bce7410616f921298a2014763f0e.tar.gz
ppe42-gcc-efa9ae36f3c2bce7410616f921298a2014763f0e.zip
PR ada/8358
* trans.c (gnu_pending_elaboration_lists): New GC root. (build_unit_elab): Use.. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58804 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/trans.c11
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index ca53a2c7224..11281d42a32 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-05 Graham Stott <graham.stott@btinternet.com>
+ PR ada/8358
+ * trans.c (gnu_pending_elaboration_lists): New GC root.
+ (build_unit_elab): Use..
+
2002-10-30 Geert Bosch <bosch@gnat.com>
PR ada/6558
* misc.c : Include optabs.h
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index 069c6f5ba48..68ebacc735c 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -88,6 +88,10 @@ tree gnu_block_stack;
handler. Not used in the zero-cost case. */
static GTY(()) tree gnu_except_ptr_stack;
+/* List of TREE_LIST nodes containing pending elaborations lists.
+ used to prevent the elaborations being reclaimed by GC. */
+static GTY(()) tree gnu_pending_elaboration_lists;
+
/* Map GNAT tree codes to GCC tree codes for simple expressions. */
static enum tree_code gnu_codes[Number_Node_Kinds];
@@ -5298,6 +5302,10 @@ build_unit_elab (gnat_unit, body_p, gnu_elab_list)
if (gnu_elab_list == 0)
return 1;
+ /* Prevent the elaboration list from being reclaimed by the GC. */
+ gnu_pending_elaboration_lists = chainon (gnu_pending_elaboration_lists,
+ gnu_elab_list);
+
/* Set our file and line number to that of the object and set up the
elaboration routine. */
gnu_decl = create_subprog_decl (create_concat_name (gnat_unit,
@@ -5358,6 +5366,9 @@ build_unit_elab (gnat_unit, body_p, gnu_elab_list)
gnu_block_stack = TREE_CHAIN (gnu_block_stack);
end_subprog_body ();
+ /* We are finished with the elaboration list it can now be discarded. */
+ gnu_pending_elaboration_lists = TREE_CHAIN (gnu_pending_elaboration_lists);
+
/* If there were no insns, we don't need an elab routine. It would
be nice to not output this one, but there's no good way to do that. */
return result;
OpenPOWER on IntegriCloud