From 64b59a80f755d6ca6b1ab909f2a267c3376803ad Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 2 May 2000 20:43:24 +0000 Subject: [PATCH] toplev.c (debug_ignore_block): Return int. * toplev.c (debug_ignore_block): Return int. * dwarf2out.c (dwarf2out_ignore_block): Likewise. * toplev.h, dwarf2out.h: Adjust. * emit-rtl.c (remove_unnecessary_notes): Test return value. * emit-rtl.c (remove_unnecessary_notes): Fix spelling of "necessary". * toplev.c, final.c, rtl.h: Adjust. From-SVN: r33616 --- gcc/ChangeLog | 17 +++++++++++++++++ gcc/dwarf2out.c | 30 +++++++++++------------------- gcc/dwarf2out.h | 2 +- gcc/emit-rtl.c | 11 +++-------- gcc/toplev.c | 22 ++++++++++++++++------ gcc/toplev.h | 2 +- 6 files changed, 49 insertions(+), 35 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e1637e28da9..83bf4e4ca02 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2000-05-02 Jason Merrill + + * Makefile.in (WARN_CFLAGS): Add -pedantic -Wno-long-long. + (LOOSE_CFLAGS): New: CFLAGS without -pedantic and -Wtraditional. + (GCC_CFLAGS): Use it. + (LANG_FLAGS_TO_PASS): New: SUBDIR_FLAGS_TO_PASS with LOOSE_CFLAGS. + * cp/Make-lang.in, java/Make-lang.in, f/Make-lang.in, ch/Make-lang.in, + objc/Make-lang.in: Use it. + + * toplev.c (debug_ignore_block): Return int. + * dwarf2out.c (dwarf2out_ignore_block): Likewise. + * toplev.h, dwarf2out.h: Adjust. + * emit-rtl.c (remove_unnecessary_notes): Test return value. + + * emit-rtl.c (remove_unnecessary_notes): Fix spelling of "necessary". + * toplev.c, final.c, rtl.h: Adjust. + 2000-05-02 Zack Weinberg * aclocal.m4 (gcc_AC_CHECK_PROG_VER): New macro. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index bf93491cfc0..2e1b689496a 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9598,31 +9598,23 @@ 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. */ +/* Returns nonzero if it is appropriate not to emit any debugging + information for BLOCK, because it doesn't contain any instructions. -void + Don't allow this for blocks with nested functions or local classes + as we would end up with orphans, and in the presence of scheduling + we may end up calling them anyway. */ + +int 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; - } + if (TREE_CODE (decl) == FUNCTION_DECL + || (TREE_CODE (decl) == TYPE_DECL && TYPE_DECL_IS_STUB (decl))) + return 0; + return 1; } /* Output a marker (i.e. a label) at a point in the assembly code which diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index 7496f9dcdf2..0b6d1b22de0 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -28,7 +28,7 @@ extern void dwarf2out_end_source_file PARAMS ((void)); extern void dwarf2out_begin_block PARAMS ((unsigned)); extern void dwarf2out_end_block PARAMS ((unsigned)); -extern void dwarf2out_ignore_block PARAMS ((tree)); +extern int dwarf2out_ignore_block PARAMS ((tree)); extern void dwarf2out_label PARAMS ((rtx)); extern void dwarf2out_decl PARAMS ((tree)); extern void dwarf2out_line PARAMS ((const char *, unsigned)); diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 9044fb56350..7ac0e8c2b30 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -2751,10 +2751,10 @@ reorder_insns_with_line_notes (from, to, after) to); } -/* Remove unncessary notes from the instruction stream. */ +/* Remove unnecessary notes from the instruction stream. */ void -remove_unncessary_notes () +remove_unnecessary_notes () { rtx insn; rtx next; @@ -2810,13 +2810,8 @@ remove_unncessary_notes () if (NOTE_BLOCK (prev) != NOTE_BLOCK (insn)) abort (); - /* Never delete the BLOCK for the outermost scope - of the function; we can refer to names from - that scope even if the block notes are messed up. */ - if (! is_body_block (NOTE_BLOCK (insn))) + if (debug_ignore_block (NOTE_BLOCK (insn))) { - debug_ignore_block (NOTE_BLOCK (insn)); - remove_insn (prev); remove_insn (insn); } diff --git a/gcc/toplev.c b/gcc/toplev.c index 0d45f6947b5..1a3549715a9 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2598,7 +2598,7 @@ rest_of_compilation (decl) /* 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 (); + remove_unnecessary_notes (); /* In function-at-a-time mode, we do not attempt to keep the BLOCK tree in sensible shape. So, we just recalculate it here. */ @@ -4924,16 +4924,26 @@ debug_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. */ +/* Returns nonzero if it is appropriate not to emit any debugging + information for BLOCK, because it doesn't contain any instructions. + This may not be the case for blocks containing nested functions, since + we may actually call such a function even though the BLOCK information + is messed up. */ -void +int debug_ignore_block (block) tree block ATTRIBUTE_UNUSED; { + /* Never delete the BLOCK for the outermost scope + of the function; we can refer to names from + that scope even if the block notes are messed up. */ + if (is_body_block (block)) + return 0; + #ifdef DWARF2_DEBUGGING_INFO if (write_symbols == DWARF2_DEBUG) - dwarf2out_ignore_block (block); + return dwarf2out_ignore_block (block); #endif + + return 1; } diff --git a/gcc/toplev.h b/gcc/toplev.h index e5a06fff093..83795329e2e 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -35,7 +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 int 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 *))