From e69ac0203725fb8da83a1cc88d32191b7a0b2c0c Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Tue, 12 Jan 2021 16:27:53 +0100 Subject: Add line debug info for virtual thunks There is no debug info when the DECL_IGNORED_P flag is set. But sometimes we have the line info of the function decl, as in the case of on virtual thunks. So instead of no line info at all, we emit at least the location of the function decl. On the other side, there are DECL_IGNORED_P functions which do not have any source line info at all. Remove those from the debug_range info, to make it clear for the debugger that the line info for these functions is invalid. This has the effect that the debugger will not step into the function without debug info. 2021-05-06 Bernd Edlinger PR ipa/97937 * debug.h (gcc_debug_hooks): Add set_ignored_loc function pointer. * dwarf2out.h (dw_fde_node::ignored_debug): New data item. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Add dummy set_ignored_loc callbacks. * debug.c (do_nothing_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * dwarf2out.c (text_section_used, cold_text_section_used): Remove. (in_text_section_p, last_text_label, last_cold_label, switch_text_ranges, switch_cold_ranges): New data items. (dwarf2out_note_section_used): Remove. (dwarf2out_begin_prologue): Set fde->ignored_debug and in_text_section_p. (mark_ignored_debug_section): New helper function. (dwarf2out_end_epilogue, dwarf2out_switch_text_section): Call mark_ignored_debug_section. (dwarf2_debug_hooks): Use dwarf2out_set_ignored_loc. (dwarf2_lineno_debug_hooks): Use dummy for set_ignored_loc. (size_of_aranges): Adjust formula for multi-part text ranges size. (output_aranges): Output multi-part text ranges. (dwarf2out_set_ignored_loc): New callback function. (dwarf2out_finish): Output multi-part text ranges. (dwarf2out_c_finalize): Clear new data items. * final.c (final_start_function_1): Call set_ignored_loc callback. (final_scan_insn_1): Likewise. * ggc-page.c (gt_ggc_mx): New helper function. * stringpool.c (gt_pch_nx): Likewise. --- gcc/ggc-page.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/ggc-page.c') diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 4d11692..1b09f0d 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -1518,6 +1518,12 @@ gt_ggc_mx (const char *& x) } void +gt_ggc_mx (char *& x) +{ + gt_ggc_m_S (x); +} + +void gt_ggc_mx (unsigned char *& x) { gt_ggc_m_S (x); -- cgit v1.1 From 0edf2e81bb02cba43b649b3f6e7258b68a779ac0 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 17 Aug 2021 10:47:02 +0200 Subject: Turn global 'ggc_force_collect' variable into 'force_collect' parameter to 'ggc_collect' This simplifies the interface and gets us rid of a global variable. No change in behavior. Clean-up for 2004-09-02 CVS commit (Subversion r86974, Git commit 0772402279c0161fe41784911b52c77e12803c42) "Better memory statistics, take 2". gcc/ * ggc.h (ggc_collect): Add 'force_collect' parameter. * ggc-page.c (ggc_collect): Use that one instead of global 'ggc_force_collect'. Adjust all users. * doc/gty.texi (Invoking the garbage collector): Update. * ggc-internal.h (ggc_force_collect): Remove. * ggc-common.c (ggc_force_collect): Likewise. * selftest.h (forcibly_ggc_collect): Remove. * ggc-tests.c (selftest::forcibly_ggc_collect): Likewise. * read-rtl-function.c (test_loading_labels): Adjust. * selftest-run-tests.c (run_tests): Likewise. --- gcc/ggc-page.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/ggc-page.c') diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 1b09f0d..a6fbeca 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -2184,7 +2184,7 @@ validate_free_objects (void) /* Top level mark-and-sweep routine. */ void -ggc_collect (void) +ggc_collect (bool force_collect) { /* Avoid frequent unnecessary work by skipping collection if the total allocations haven't expanded much since the last @@ -2196,7 +2196,7 @@ ggc_collect (void) memory_block_pool::trim (); float min_expand = allocated_last_gc * param_ggc_min_expand / 100; - if (G.allocated < allocated_last_gc + min_expand && !ggc_force_collect) + if (G.allocated < allocated_last_gc + min_expand && !force_collect) return; timevar_push (TV_GC); -- cgit v1.1 From 602fca427df6c5f7452677cfcdd16a5b9a3ca86a Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 17 Aug 2021 21:15:46 +0200 Subject: Turn 'bool force_collect' parameter to 'ggc_collect' into an 'enum ggc_collect mode' ... to make the meaning more explicit to the reader of the code. Follow-up to recent commit 0edf2e81bb02cba43b649b3f6e7258b68a779ac0 "Turn global 'ggc_force_collect' variable into 'force_collect' parameter to 'ggc_collect'". gcc/ * ggc.h (enum ggc_collect): New. (ggc_collect): Use it. * ggc-page.c: Adjust. * ggc-common.c: Likewise. * ggc-tests.c: Likewise. * read-rtl-function.c: Likewise. * selftest-run-tests.c: Likewise. * doc/gty.texi (Invoking the garbage collector): Likewise. Suggested-by: David Malcolm --- gcc/ggc-page.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/ggc-page.c') diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index a6fbeca..1c49643 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -2184,7 +2184,7 @@ validate_free_objects (void) /* Top level mark-and-sweep routine. */ void -ggc_collect (bool force_collect) +ggc_collect (enum ggc_collect mode) { /* Avoid frequent unnecessary work by skipping collection if the total allocations haven't expanded much since the last @@ -2196,7 +2196,8 @@ ggc_collect (bool force_collect) memory_block_pool::trim (); float min_expand = allocated_last_gc * param_ggc_min_expand / 100; - if (G.allocated < allocated_last_gc + min_expand && !force_collect) + if (mode == GGC_COLLECT_HEURISTIC + && G.allocated < allocated_last_gc + min_expand) return; timevar_push (TV_GC); -- cgit v1.1