aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/dwarf2cfi.cc9
-rw-r--r--gcc/dwarf2out.h1
-rw-r--r--gcc/ggc-common.cc23
-rw-r--r--gcc/ggc.h2
-rw-r--r--gcc/toplev.cc3
5 files changed, 37 insertions, 1 deletions
diff --git a/gcc/dwarf2cfi.cc b/gcc/dwarf2cfi.cc
index ddc728f..f1777c0 100644
--- a/gcc/dwarf2cfi.cc
+++ b/gcc/dwarf2cfi.cc
@@ -3822,4 +3822,13 @@ make_pass_dwarf2_frame (gcc::context *ctxt)
return new pass_dwarf2_frame (ctxt);
}
+void dwarf2cfi_cc_finalize ()
+{
+ add_cfi_insn = NULL;
+ add_cfi_vec = NULL;
+ cur_trace = NULL;
+ cur_row = NULL;
+ cur_cfa = NULL;
+}
+
#include "gt-dwarf2cfi.h"
diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h
index 870b56a..61a9960 100644
--- a/gcc/dwarf2out.h
+++ b/gcc/dwarf2out.h
@@ -419,6 +419,7 @@ struct fixed_point_type_info
} scale_factor;
};
+void dwarf2cfi_cc_finalize (void);
void dwarf2out_cc_finalize (void);
/* Some DWARF internals are exposed for the needs of DWARF-based debug
diff --git a/gcc/ggc-common.cc b/gcc/ggc-common.cc
index bed7a9d..95803fa 100644
--- a/gcc/ggc-common.cc
+++ b/gcc/ggc-common.cc
@@ -86,7 +86,7 @@ ggc_mark_roots (void)
for (rt = gt_ggc_deletable_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
- memset (rti->base, 0, rti->stride);
+ memset (rti->base, 0, rti->stride * rti->nelt);
for (rt = gt_ggc_rtab; *rt; rt++)
ggc_mark_root_tab (*rt);
@@ -1293,3 +1293,24 @@ report_heap_memory_use ()
SIZE_AMOUNT (MALLINFO_FN ().arena));
#endif
}
+
+/* Forcibly clear all GTY roots. */
+
+void
+ggc_common_finalize ()
+{
+ const struct ggc_root_tab *const *rt;
+ const_ggc_root_tab_t rti;
+
+ for (rt = gt_ggc_deletable_rtab; *rt; rt++)
+ for (rti = *rt; rti->base != NULL; rti++)
+ memset (rti->base, 0, rti->stride * rti->nelt);
+
+ for (rt = gt_ggc_rtab; *rt; rt++)
+ for (rti = *rt; rti->base != NULL; rti++)
+ memset (rti->base, 0, rti->stride * rti->nelt);
+
+ for (rt = gt_pch_scalar_rtab; *rt; rt++)
+ for (rti = *rt; rti->base != NULL; rti++)
+ memset (rti->base, 0, rti->stride * rti->nelt);
+}
diff --git a/gcc/ggc.h b/gcc/ggc.h
index 34108e2..3280314 100644
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -368,4 +368,6 @@ inline void gt_ggc_mx (unsigned long int) { }
inline void gt_ggc_mx (long long int) { }
inline void gt_ggc_mx (unsigned long long int) { }
+extern void ggc_common_finalize ();
+
#endif
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index 6c1a6f4..db62e3e 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -2336,6 +2336,7 @@ toplev::finalize (void)
cgraph_cc_finalize ();
cgraphunit_cc_finalize ();
symtab_thunks_cc_finalize ();
+ dwarf2cfi_cc_finalize ();
dwarf2out_cc_finalize ();
gcse_cc_finalize ();
ipa_cp_cc_finalize ();
@@ -2350,6 +2351,8 @@ toplev::finalize (void)
save_decoded_options = NULL;
save_decoded_options_count = 0;
+ ggc_common_finalize ();
+
/* Clean up the context (and pass_manager etc). */
delete g;
g = NULL;