diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2000-03-03 19:48:46 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-03-03 19:48:46 -0500 |
commit | fcd7f76b289ddadbb67057154547d570b94f2b23 (patch) | |
tree | 29b58916ce9e193f2b31a39bfb2eb5cdae4dfcef | |
parent | 6db201439a6635a374ec572561d961c9cf734ee2 (diff) | |
download | gcc-fcd7f76b289ddadbb67057154547d570b94f2b23.zip gcc-fcd7f76b289ddadbb67057154547d570b94f2b23.tar.gz gcc-fcd7f76b289ddadbb67057154547d570b94f2b23.tar.bz2 |
dwarf2out.c (dwarf2out_frame_debug): Add cast to silence warning.
* dwarf2out.c (dwarf2out_frame_debug): Add cast to silence warning.
(dwarf2out_decl): Functions can now have DECL_IGNORED_P.
(gen_decl_die): Likewise.
* dwarfout.c (dwarfout_file_scope_decl): Likewise.
(output_decl): Likewise.
* varasm.c (make_function_rtl): If we change the name used in the
rtl, update DECL_ASSEMBLER_NAME accordingly.
(make_decl_rtl): Likewise.
* toplev.c (rest_of_compilation): Tweak formatting.
* toplev.c (rest_of_compilation): find_loop_tree_blocks before
remove_unnecessary_notes.
(debug_ignore_block): New fn.
* toplev.h: Declare it.
* emit-rtl.c (remove_unncessary_notes): Call it.
* dwarf2out.c (dwarf2out_ignore_block): New fn.
* dwarf2out.h: Declare it.
* final.c (final_start_function): Don't call remove_unnecessary_notes
if we did insn scheduling.
From-SVN: r32320
-rw-r--r-- | gcc/ChangeLog | 26 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 53 | ||||
-rw-r--r-- | gcc/dwarfout.c | 22 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 2 | ||||
-rw-r--r-- | gcc/final.c | 5 | ||||
-rw-r--r-- | gcc/toplev.c | 33 | ||||
-rw-r--r-- | gcc/toplev.h | 1 | ||||
-rw-r--r-- | gcc/varasm.c | 2 |
8 files changed, 93 insertions, 51 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 68b870c..6cf650d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,27 @@ +2000-03-03 Jason Merrill <jason@casey.cygnus.com> + + * dwarf2out.c (dwarf2out_frame_debug): Add cast to silence warning. + (dwarf2out_decl): Functions can now have DECL_IGNORED_P. + (gen_decl_die): Likewise. + * dwarfout.c (dwarfout_file_scope_decl): Likewise. + (output_decl): Likewise. + + * varasm.c (make_function_rtl): If we change the name used in the + rtl, update DECL_ASSEMBLER_NAME accordingly. + (make_decl_rtl): Likewise. + + * toplev.c (rest_of_compilation): Tweak formatting. + + * toplev.c (rest_of_compilation): find_loop_tree_blocks before + remove_unnecessary_notes. + (debug_ignore_block): New fn. + * toplev.h: Declare it. + * emit-rtl.c (remove_unncessary_notes): Call it. + * dwarf2out.c (dwarf2out_ignore_block): New fn. + * dwarf2out.h: Declare it. + * final.c (final_start_function): Don't call remove_unnecessary_notes + if we did insn scheduling. + 2000-03-03 Zack Weinberg <zack@wolery.cumb.org> * cppinit.c (cpp_handle_option): Set opts->pedantic directly. @@ -10,7 +34,7 @@ Fri Mar 3 14:56:12 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> 2000-03-03 Jonathan Larmour <jlarmour@cygnus.co.uk> - * config/mips/elf.h (CTOR_LISTS_DEFINED_EXTERNALLY): Added. + * mips/elf.h (CTOR_LISTS_DEFINED_EXTERNALLY): Added. 2000-03-03 Richard Henderson <rth@cygnus.com> diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index d3b84cd..cb8b723 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -1355,7 +1355,7 @@ dwarf2out_frame_debug (insn) { /* Set up state for generating call frame debug info. */ lookup_cfa (&cfa_reg, &cfa_offset); - if (cfa_reg != DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM)) + if (cfa_reg != (unsigned long) DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM)) abort (); cfa_reg = STACK_POINTER_REGNUM; cfa_store_reg = cfa_reg; @@ -9296,12 +9296,8 @@ gen_decl_die (decl, context_die) if (TREE_CODE (decl) == ERROR_MARK) return; - /* If this ..._DECL node is marked to be ignored, then ignore it. But don't - ignore a function definition, since that would screw up our count of - blocks, and that in turn will completely screw up the labels we will - reference in subsequent DW_AT_low_pc and DW_AT_high_pc attributes (for - subsequent blocks). */ - if (DECL_IGNORED_P (decl) && TREE_CODE (decl) != FUNCTION_DECL) + /* If this ..._DECL node is marked to be ignored, then ignore it. */ + if (DECL_IGNORED_P (decl)) return; switch (TREE_CODE (decl)) @@ -9460,21 +9456,9 @@ dwarf2out_decl (decl) if (TREE_CODE (decl) == ERROR_MARK) return; - /* If this ..._DECL node is marked to be ignored, then ignore it. We gotta - hope that the node in question doesn't represent a function definition. - If it does, then totally ignoring it is bound to screw up our count of - blocks, and that in turn will completely screw up the labels we will - reference in subsequent DW_AT_low_pc and DW_AT_high_pc attributes (for - subsequent blocks). (It's too bad that BLOCK nodes don't carry their - own sequence numbers with them!) */ + /* If this ..._DECL node is marked to be ignored, then ignore it. */ if (DECL_IGNORED_P (decl)) - { - if (TREE_CODE (decl) == FUNCTION_DECL - && DECL_INITIAL (decl) != NULL) - abort (); - - return; - } + return; switch (TREE_CODE (decl)) { @@ -9594,6 +9578,33 @@ dwarf2out_end_block (blocknum) ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, BLOCK_END_LABEL, blocknum); } +/* We've decided not to emit any debugging information for BLOCK; make + sure that we don't end up with orphans as a result. */ + +void +dwarf2out_ignore_block (block) + tree block; +{ + tree decl; + for (decl = BLOCK_VARS (block); decl; decl = TREE_CHAIN (decl)) + { + dw_die_ref die; + + if (TREE_CODE (decl) == FUNCTION_DECL) + die = lookup_decl_die (decl); + else if (TREE_CODE (decl) == TYPE_DECL && TYPE_DECL_IS_STUB (decl)) + die = lookup_type_die (TREE_TYPE (decl)); + else + die = NULL; + + /* Just give them a dummy value for parent so dwarf2out_finish + doesn't blow up; we would use add_child_die if we really + wanted to add them to comp_unit_die's children. */ + if (die && die->die_parent == 0) + die->die_parent = comp_unit_die; + } +} + /* Output a marker (i.e. a label) at a point in the assembly code which corresponds to a given source level label. */ diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index 153c684..d639eb9 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -4787,13 +4787,9 @@ output_decl (decl, containing_scope) && (TREE_CODE (TYPE_FIELDS (TREE_TYPE (decl))) == ERROR_MARK)))) return; - /* If this ..._DECL node is marked to be ignored, then ignore it. - But don't ignore a function definition, since that would screw - up our count of blocks, and that it turn will completely screw up the - labels we will reference in subsequent AT_low_pc and AT_high_pc - attributes (for subsequent blocks). */ + /* If this ..._DECL node is marked to be ignored, then ignore it. */ - if (DECL_IGNORED_P (decl) && TREE_CODE (decl) != FUNCTION_DECL) + if (DECL_IGNORED_P (decl)) return; switch (TREE_CODE (decl)) @@ -5133,20 +5129,10 @@ dwarfout_file_scope_decl (decl, set_finalizing) if (TREE_CODE (decl) == ERROR_MARK) return; - /* If this ..._DECL node is marked to be ignored, then ignore it. We - gotta hope that the node in question doesn't represent a function - definition. If it does, then totally ignoring it is bound to screw - up our count of blocks, and that it turn will completely screw up the - labels we will reference in subsequent AT_low_pc and AT_high_pc - attributes (for subsequent blocks). (It's too bad that BLOCK nodes - don't carry their own sequence numbers with them!) */ + /* If this ..._DECL node is marked to be ignored, then ignore it. */ if (DECL_IGNORED_P (decl)) - { - if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl) != NULL) - abort (); - return; - } + return; switch (TREE_CODE (decl)) { diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index c6e5cb1..f43a181 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -2710,6 +2710,8 @@ remove_unncessary_notes () nesting structure. */ if (NOTE_BLOCK (prev) != NOTE_BLOCK (insn)) abort (); + + debug_ignore_block (NOTE_BLOCK (insn)); remove_insn (prev); remove_insn (insn); diff --git a/gcc/final.c b/gcc/final.c index 948ecd3..d5a1a30 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1644,7 +1644,10 @@ final_start_function (first, file, optimize) if (write_symbols) { number_blocks (current_function_decl); - remove_unncessary_notes (); + /* Scheduling packs block notes together at the top of a basic block, + so we can't learn anything from them. */ + if (! flag_schedule_insns && ! flag_schedule_insns_after_reload) + remove_unncessary_notes (); /* We never actually put out begin/end notes for the top-level block in the function. But, conceptually, that block is always needed. */ diff --git a/gcc/toplev.c b/gcc/toplev.c index 209fd09..05b1577 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2845,14 +2845,15 @@ rest_of_compilation (decl) have been run to re-initialize it. */ cse_not_expected = ! optimize; - /* First, remove any notes we don't need. That will make iterating + /* First, make sure that NOTE_BLOCK is set correctly for each + NOTE_INSN_BLOCK_BEG/NOTE_INSN_BLOCK_END note. */ + find_loop_tree_blocks (); + + /* Then remove any notes we don't need. That will make iterating over the instruction sequence faster, and allow the garbage collector to reclaim the memory used by the notes. */ remove_unncessary_notes (); - /* We need to make sure that NOTE_BLOCK is set correctly - for each NOTE_INSN_BLOCK_BEG/NOTE_INSN_BLOCK_END note. */ - find_loop_tree_blocks (); /* In function-at-a-time mode, we do not attempt to keep the BLOCK tree in sensible shape. So, we just recalculate it here. */ if (cfun->x_whole_function_mode_p) @@ -2928,17 +2929,15 @@ rest_of_compilation (decl) for those functions that need to be output. Also defer those functions that we are supposed to defer. */ - if (inlinable) - DECL_DEFER_OUTPUT (decl) = 1; - - if (DECL_DEFER_OUTPUT (decl) + if (inlinable || (DECL_INLINE (decl) && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl) && ! flag_keep_inline_functions) || DECL_EXTERNAL (decl)))) - { - DECL_DEFER_OUTPUT (decl) = 1; + DECL_DEFER_OUTPUT (decl) = 1; + if (DECL_DEFER_OUTPUT (decl)) + { /* If -Wreturn-type, we have to do a bit of compilation. However, if we just fall through we will call save_for_inline_copying() which results in excessive @@ -5160,3 +5159,17 @@ debug_undef (lineno, buffer) dwarf2out_undef (lineno, buffer); #endif /* DWARF2_DEBUGGING_INFO */ } + +/* Tell the debugging backend that we've decided not to emit any + debugging information for BLOCK, so it can clean up after any local + classes or nested functions. */ + +void +debug_ignore_block (block) + tree block; +{ +#ifdef DWARF2_DEBUGGING_INFO + if (write_symbols == DWARF2_DEBUG) + dwarf2out_ignore_block (block); +#endif +} diff --git a/gcc/toplev.h b/gcc/toplev.h index 74300b4..49990a8 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -35,6 +35,7 @@ extern void debug_start_source_file PARAMS ((char *)); extern void debug_end_source_file PARAMS ((unsigned)); extern void debug_define PARAMS ((unsigned, char *)); extern void debug_undef PARAMS ((unsigned, char *)); +extern void debug_ignore_block PARAMS ((union tree_node *)); extern void fatal PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; extern void fatal_io_error PARAMS ((const char *)) diff --git a/gcc/varasm.c b/gcc/varasm.c index c84affc..751ce82 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -553,6 +553,7 @@ make_function_rtl (decl) if (DECL_RTL (decl) == 0) { + DECL_ASSEMBLER_NAME (decl) = get_identifier (name); DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), gen_rtx_SYMBOL_REF (Pmode, name)); @@ -792,6 +793,7 @@ make_decl_rtl (decl, asmspec, top_level) name = new_name; } + DECL_ASSEMBLER_NAME (decl) = get_identifier (name); DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), gen_rtx_SYMBOL_REF (Pmode, name)); MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl); |