Commit fcd7f76b by Jason Merrill

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
parent 6db20143
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> 2000-03-03 Zack Weinberg <zack@wolery.cumb.org>
* cppinit.c (cpp_handle_option): Set opts->pedantic directly. * 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> ...@@ -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> 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> 2000-03-03 Richard Henderson <rth@cygnus.com>
......
...@@ -1355,7 +1355,7 @@ dwarf2out_frame_debug (insn) ...@@ -1355,7 +1355,7 @@ dwarf2out_frame_debug (insn)
{ {
/* Set up state for generating call frame debug info. */ /* Set up state for generating call frame debug info. */
lookup_cfa (&cfa_reg, &cfa_offset); 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 (); abort ();
cfa_reg = STACK_POINTER_REGNUM; cfa_reg = STACK_POINTER_REGNUM;
cfa_store_reg = cfa_reg; cfa_store_reg = cfa_reg;
...@@ -9296,12 +9296,8 @@ gen_decl_die (decl, context_die) ...@@ -9296,12 +9296,8 @@ gen_decl_die (decl, context_die)
if (TREE_CODE (decl) == ERROR_MARK) if (TREE_CODE (decl) == ERROR_MARK)
return; return;
/* If this ..._DECL node is marked to be ignored, then ignore it. But don't /* If this ..._DECL node is marked to be ignored, then ignore it. */
ignore a function definition, since that would screw up our count of if (DECL_IGNORED_P (decl))
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)
return; return;
switch (TREE_CODE (decl)) switch (TREE_CODE (decl))
...@@ -9460,21 +9456,9 @@ dwarf2out_decl (decl) ...@@ -9460,21 +9456,9 @@ dwarf2out_decl (decl)
if (TREE_CODE (decl) == ERROR_MARK) if (TREE_CODE (decl) == ERROR_MARK)
return; return;
/* If this ..._DECL node is marked to be ignored, then ignore it. We gotta /* If this ..._DECL node is marked to be ignored, then ignore it. */
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 (DECL_IGNORED_P (decl)) if (DECL_IGNORED_P (decl))
{ return;
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_INITIAL (decl) != NULL)
abort ();
return;
}
switch (TREE_CODE (decl)) switch (TREE_CODE (decl))
{ {
...@@ -9594,6 +9578,33 @@ dwarf2out_end_block (blocknum) ...@@ -9594,6 +9578,33 @@ dwarf2out_end_block (blocknum)
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, BLOCK_END_LABEL, 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 /* Output a marker (i.e. a label) at a point in the assembly code which
corresponds to a given source level label. */ corresponds to a given source level label. */
......
...@@ -4787,13 +4787,9 @@ output_decl (decl, containing_scope) ...@@ -4787,13 +4787,9 @@ output_decl (decl, containing_scope)
&& (TREE_CODE (TYPE_FIELDS (TREE_TYPE (decl))) == ERROR_MARK)))) && (TREE_CODE (TYPE_FIELDS (TREE_TYPE (decl))) == ERROR_MARK))))
return; return;
/* If this ..._DECL node is marked to be ignored, then ignore it. /* 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 (DECL_IGNORED_P (decl) && TREE_CODE (decl) != FUNCTION_DECL) if (DECL_IGNORED_P (decl))
return; return;
switch (TREE_CODE (decl)) switch (TREE_CODE (decl))
...@@ -5133,20 +5129,10 @@ dwarfout_file_scope_decl (decl, set_finalizing) ...@@ -5133,20 +5129,10 @@ dwarfout_file_scope_decl (decl, set_finalizing)
if (TREE_CODE (decl) == ERROR_MARK) if (TREE_CODE (decl) == ERROR_MARK)
return; return;
/* If this ..._DECL node is marked to be ignored, then ignore it. We /* If this ..._DECL node is marked to be ignored, then ignore it. */
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 (DECL_IGNORED_P (decl)) if (DECL_IGNORED_P (decl))
{ return;
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl) != NULL)
abort ();
return;
}
switch (TREE_CODE (decl)) switch (TREE_CODE (decl))
{ {
......
...@@ -2710,6 +2710,8 @@ remove_unncessary_notes () ...@@ -2710,6 +2710,8 @@ remove_unncessary_notes ()
nesting structure. */ nesting structure. */
if (NOTE_BLOCK (prev) != NOTE_BLOCK (insn)) if (NOTE_BLOCK (prev) != NOTE_BLOCK (insn))
abort (); abort ();
debug_ignore_block (NOTE_BLOCK (insn));
remove_insn (prev); remove_insn (prev);
remove_insn (insn); remove_insn (insn);
......
...@@ -1644,7 +1644,10 @@ final_start_function (first, file, optimize) ...@@ -1644,7 +1644,10 @@ final_start_function (first, file, optimize)
if (write_symbols) if (write_symbols)
{ {
number_blocks (current_function_decl); 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 /* We never actually put out begin/end notes for the top-level
block in the function. But, conceptually, that block is block in the function. But, conceptually, that block is
always needed. */ always needed. */
......
...@@ -2845,14 +2845,15 @@ rest_of_compilation (decl) ...@@ -2845,14 +2845,15 @@ rest_of_compilation (decl)
have been run to re-initialize it. */ have been run to re-initialize it. */
cse_not_expected = ! optimize; 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 over the instruction sequence faster, and allow the garbage
collector to reclaim the memory used by the notes. */ collector to reclaim the memory used by the notes. */
remove_unncessary_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 /* In function-at-a-time mode, we do not attempt to keep the BLOCK
tree in sensible shape. So, we just recalculate it here. */ tree in sensible shape. So, we just recalculate it here. */
if (cfun->x_whole_function_mode_p) if (cfun->x_whole_function_mode_p)
...@@ -2928,17 +2929,15 @@ rest_of_compilation (decl) ...@@ -2928,17 +2929,15 @@ rest_of_compilation (decl)
for those functions that need to be output. Also defer those for those functions that need to be output. Also defer those
functions that we are supposed to defer. */ functions that we are supposed to defer. */
if (inlinable) if (inlinable
DECL_DEFER_OUTPUT (decl) = 1;
if (DECL_DEFER_OUTPUT (decl)
|| (DECL_INLINE (decl) || (DECL_INLINE (decl)
&& ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl) && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
&& ! flag_keep_inline_functions) && ! flag_keep_inline_functions)
|| DECL_EXTERNAL (decl)))) || 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. /* If -Wreturn-type, we have to do a bit of compilation.
However, if we just fall through we will call However, if we just fall through we will call
save_for_inline_copying() which results in excessive save_for_inline_copying() which results in excessive
...@@ -5160,3 +5159,17 @@ debug_undef (lineno, buffer) ...@@ -5160,3 +5159,17 @@ debug_undef (lineno, buffer)
dwarf2out_undef (lineno, buffer); dwarf2out_undef (lineno, buffer);
#endif /* DWARF2_DEBUGGING_INFO */ #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
}
...@@ -35,6 +35,7 @@ extern void debug_start_source_file PARAMS ((char *)); ...@@ -35,6 +35,7 @@ extern void debug_start_source_file PARAMS ((char *));
extern void debug_end_source_file PARAMS ((unsigned)); extern void debug_end_source_file PARAMS ((unsigned));
extern void debug_define PARAMS ((unsigned, char *)); extern void debug_define PARAMS ((unsigned, char *));
extern void debug_undef 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 *, ...)) extern void fatal PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
extern void fatal_io_error PARAMS ((const char *)) extern void fatal_io_error PARAMS ((const char *))
......
...@@ -553,6 +553,7 @@ make_function_rtl (decl) ...@@ -553,6 +553,7 @@ make_function_rtl (decl)
if (DECL_RTL (decl) == 0) if (DECL_RTL (decl) == 0)
{ {
DECL_ASSEMBLER_NAME (decl) = get_identifier (name);
DECL_RTL (decl) DECL_RTL (decl)
= gen_rtx_MEM (DECL_MODE (decl), = gen_rtx_MEM (DECL_MODE (decl),
gen_rtx_SYMBOL_REF (Pmode, name)); gen_rtx_SYMBOL_REF (Pmode, name));
...@@ -792,6 +793,7 @@ make_decl_rtl (decl, asmspec, top_level) ...@@ -792,6 +793,7 @@ make_decl_rtl (decl, asmspec, top_level)
name = new_name; name = new_name;
} }
DECL_ASSEMBLER_NAME (decl) = get_identifier (name);
DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl),
gen_rtx_SYMBOL_REF (Pmode, name)); gen_rtx_SYMBOL_REF (Pmode, name));
MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl); MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment