aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@casey.cygnus.com>2000-05-02 20:43:24 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-05-02 16:43:24 -0400
commit64b59a80f755d6ca6b1ab909f2a267c3376803ad (patch)
treea122f23eb74b7af597fd74a1558c5fac6ab9e969
parent7145d9fe6bb782d384cab328c028507b4f8f435a (diff)
downloadgcc-64b59a80f755d6ca6b1ab909f2a267c3376803ad.zip
gcc-64b59a80f755d6ca6b1ab909f2a267c3376803ad.tar.gz
gcc-64b59a80f755d6ca6b1ab909f2a267c3376803ad.tar.bz2
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
-rw-r--r--gcc/ChangeLog17
-rw-r--r--gcc/dwarf2out.c30
-rw-r--r--gcc/dwarf2out.h2
-rw-r--r--gcc/emit-rtl.c11
-rw-r--r--gcc/toplev.c22
-rw-r--r--gcc/toplev.h2
6 files changed, 49 insertions, 35 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e1637e2..83bf4e4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,20 @@
+2000-05-02 Jason Merrill <jason@casey.cygnus.com>
+
+ * 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 <zack@wolery.cumb.org>
* aclocal.m4 (gcc_AC_CHECK_PROG_VER): New macro.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index bf93491..2e1b689 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 7496f9d..0b6d1b2 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 9044fb5..7ac0e8c 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 0d45f69..1a35497 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 e5a06ff..8379532 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 *))