diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-11-27 09:48:56 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-11-27 09:48:56 +0100 |
commit | b8cb3096f78581c16d87469706e49b1a4ec345f0 (patch) | |
tree | e81f0e0046a42d208b6c8cc59980e1aafa2275bb /gcc/final.c | |
parent | 9adeb64ab940db8fe484e6344dc28ec86f1a83bc (diff) | |
download | gcc-b8cb3096f78581c16d87469706e49b1a4ec345f0.zip gcc-b8cb3096f78581c16d87469706e49b1a4ec345f0.tar.gz gcc-b8cb3096f78581c16d87469706e49b1a4ec345f0.tar.bz2 |
re PR debug/81307 (g++.dg/debug/debug9.C -gstabs FAILs)
PR debug/81307
* dbxout.c (lastlineno): New variable.
(dbx_debug_hooks): Use dbxout_switch_text_section as
switch_text_section debug hook.
(dbxout_function_end): Switch to current_function_section
rather than function_section. If crtl->has_bb_partition,
output just one N_FUN, depending on in_cold_section_p.
(dbxout_source_line): Remember last lineno in lastlineno.
(dbxout_switch_text_section): New function.
(dbxout_function_decl): Adjust dbxout_block caller.
(dbx_block_with_cold_children): New function.
(dbxout_block): Return true if any LBRAC/RBRAC have been
emitted. Use dbx_block_with_cold_children at depth == 0
in second partition. Add PARENT_BLOCKNUM argument, pass
it optionally adjusted to children. Output LBRAC/RBRAC
around recursive call only if the block is in the current
partition, if not and anything was output, emit empty
range LBRAC/RBRAC.
* final.c (final_scan_insn): Compute cold_function_name
before calling switch_text_section debug hook. Call
that hook even if dwarf2out_do_frame if not emitting
dwarf debug info.
* g++.dg/debug/debug9.C: Remove -fno-reorder-blocks-and-partition
workaround.
From-SVN: r255161
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/final.c b/gcc/final.c index 672c5bb..fdae241 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -2210,8 +2210,17 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, case NOTE_INSN_SWITCH_TEXT_SECTIONS: in_cold_section_p = !in_cold_section_p; + if (in_cold_section_p) + cold_function_name + = clone_function_name (current_function_decl, "cold"); + if (dwarf2out_do_frame ()) - dwarf2out_switch_text_section (); + { + dwarf2out_switch_text_section (); + if (!dwarf2_debug_info_emitted_p (current_function_decl) + && !DECL_IGNORED_P (current_function_decl)) + debug_hooks->switch_text_section (); + } else if (!DECL_IGNORED_P (current_function_decl)) debug_hooks->switch_text_section (); @@ -2223,8 +2232,6 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, suffixing "cold" to the original function's name. */ if (in_cold_section_p) { - cold_function_name - = clone_function_name (current_function_decl, "cold"); #ifdef ASM_DECLARE_COLD_FUNCTION_NAME ASM_DECLARE_COLD_FUNCTION_NAME (asm_out_file, IDENTIFIER_POINTER |