OSDN Git Service

* toplev.c (debug_ignore_block): Return int.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 May 2000 20:43:24 +0000 (20:43 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 May 2000 20:43:24 +0000 (20:43 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33616 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dwarf2out.c
gcc/dwarf2out.h
gcc/emit-rtl.c
gcc/toplev.c
gcc/toplev.h

index e1637e2..83bf4e4 100644 (file)
@@ -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.
index bf93491..2e1b689 100644 (file)
@@ -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
index 7496f9d..0b6d1b2 100644 (file)
@@ -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));
index 9044fb5..7ac0e8c 100644 (file)
@@ -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);
                    }
index 0d45f69..1a35497 100644 (file)
@@ -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;
 }
index e5a06ff..8379532 100644 (file)
@@ -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 *))