OSDN Git Service

2006-02-08 Paolo Bonzini <bonzini@gnu.org>
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Feb 2006 08:13:20 +0000 (08:13 +0000)
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Feb 2006 08:13:20 +0000 (08:13 +0000)
* passes.c (register_one_dump_file): Accept the current properties
instead of pass number.  Adjust call to dump_register.  Remove
duplicated code.
(register_dump_files): Now a wrapper around...
(register_dump_files_1): ... this one.  Do not modify the pass
structure.
(next_pass_1): Cosmetic fix.
(execute_todo): Keep second parameter only.  Use curr_properties instead
of fetching it from the pass structure.  Check and set last_verified.
(execute_one_pass): Handle TODO_set_props.  Use curr_properties
instead of fetching it from the pass structure.  Fix calls to
execute_todo.  Update curr_properties and initialize .vcg RTL dump
after running the pass.  Reset last_verified.
* tree-dump.c (dump_files): Renumber consecutively.  Put .cgraph dump
at the beginning.
(FIRST_AUTO_NUMBERED_DUMP): New.
(dump_register): Remove "num" parameter, assign it within the
function.
(get_dump_file_name): Modify template for dumps.
* tree-dump.h (dump_register): Adjust prototype.
* tree-pass.h (enum tree_dump_index): Move cgraph at the beginning.
(PROP_trees): Add PROP_gimple_lomp.
(TODO_set_props): New.
        * gimple-low.c (pass_lower_cf): Do not destroy PROP_gimple_lcf.
        * tree-eh.c (pass_lower_eh): Do not destroy PROP_gimple_leh.
        * cfgexpand.c (pass_expand): Destroy PROP_trees.

gcc/testsuite:
2006-02-08  Paolo Bonzini  <bonzini@gnu.org>

* lib/gcc-dg.exp (cleanup-rtl-dump, cleanup-tree-dump,
cleanup-ipa-dump): Update dump file glob patterns.
* lib/scantree.exp (scan-tree-dump, scan-tree-dump-times,
scan-tree-dump-not, scan-tree-dump-dem): Likewise.
* lib/scanipa.exp (scan-ipa-dump, scan-ipa-dump-times,
scan-ipa-dump-not, scan-ipa-dump-dem): Likewise.

* lib/scanrtl.exp: New.
* lib/gcc-dg.exp: Load it.
* objc.dg/stubify-2.m: Use scan-rtl-dump-not.

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

12 files changed:
gcc/ChangeLog
gcc/cfgexpand.c
gcc/gimple-low.c
gcc/passes.c
gcc/testsuite/ChangeLog
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/scanipa.exp
gcc/testsuite/objc.dg/stubify-2.m
gcc/tree-dump.c
gcc/tree-dump.h
gcc/tree-eh.c
gcc/tree-pass.h

index b75b3b3..65180f3 100644 (file)
@@ -1,3 +1,33 @@
+2006-02-08  Paolo Bonzini  <bonzini@gnu.org>
+
+       * passes.c (register_one_dump_file): Accept the current properties
+       instead of pass number.  Adjust call to dump_register.  Remove
+       duplicated code.
+       (register_dump_files): Now a wrapper around...
+       (register_dump_files_1): ... this one.  Do not modify the pass
+       structure.
+       (next_pass_1): Cosmetic fix.
+       (execute_todo): Keep second parameter only.  Use curr_properties instead
+       of fetching it from the pass structure.  Check and set last_verified.
+       (execute_one_pass): Handle TODO_set_props.  Use curr_properties
+       instead of fetching it from the pass structure.  Fix calls to
+       execute_todo.  Update curr_properties and initialize .vcg RTL dump
+       after running the pass.  Reset last_verified.
+       * tree-dump.c (dump_files): Renumber consecutively.  Put .cgraph dump
+       at the beginning.
+       (FIRST_AUTO_NUMBERED_DUMP): New.
+       (dump_register): Remove "num" parameter, assign it within the
+       function.
+       (get_dump_file_name): Modify template for dumps.
+       * tree-dump.h (dump_register): Adjust prototype.
+       * tree-pass.h (enum tree_dump_index): Move cgraph at the beginning.
+       (PROP_trees): Add PROP_gimple_lomp.
+       (TODO_set_props): New.
+       * gimple-low.c (pass_lower_cf): Do not destroy PROP_gimple_lcf.
+       * tree-eh.c (pass_lower_eh): Do not destroy PROP_gimple_leh.
+       * cfgexpand.c (pass_expand): Destroy PROP_trees.
+
+
 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
 
        * config.gcc (sparc-*-linux*): Add sparc/t-linux to tmake_file.
index 5548449..c0bf209 100644 (file)
@@ -1699,7 +1699,7 @@ struct tree_opt_pass pass_expand =
   /* ??? If TER is enabled, we actually receive GENERIC.  */
   PROP_gimple_leh | PROP_cfg,           /* properties_required */
   PROP_rtl,                             /* properties_provided */
-  PROP_gimple_leh,                     /* properties_destroyed */
+  PROP_trees,                          /* properties_destroyed */
   0,                                    /* todo_flags_start */
   TODO_dump_func,                       /* todo_flags_finish */
   'r'                                  /* letter */
index a298cbb..69f9894 100644 (file)
@@ -131,7 +131,7 @@ struct tree_opt_pass pass_lower_cf =
   0,                                   /* tv_id */
   PROP_gimple_any,                     /* properties_required */
   PROP_gimple_lcf,                     /* properties_provided */
-  PROP_gimple_any,                     /* properties_destroyed */
+  0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
   TODO_dump_func,                      /* todo_flags_finish */
   0                                    /* letter */
index 8234ba1..5e02695 100644 (file)
@@ -304,10 +304,12 @@ struct tree_opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
    enabled or not.  */
 
 static void
-register_one_dump_file (struct tree_opt_pass *pass, bool ipa, int n)
+register_one_dump_file (struct tree_opt_pass *pass, bool ipa, int properties)
 {
   char *dot_name, *flag_name, *glob_name;
+  const char *prefix;
   char num[10];
+  int flags;
 
   /* See below in next_pass_1.  */
   num[0] = '\0';
@@ -317,52 +319,34 @@ register_one_dump_file (struct tree_opt_pass *pass, bool ipa, int n)
 
   dot_name = concat (".", pass->name, num, NULL);
   if (ipa)
-    {
-      flag_name = concat ("ipa-", pass->name, num, NULL);
-      glob_name = concat ("ipa-", pass->name, NULL);
-      /* First IPA dump is cgraph that is dumped via separate channels.  */
-      pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
-                                                TDF_IPA, n + 1, 0);
-    }
-  else if (pass->properties_provided & PROP_trees)
-    {
-      flag_name = concat ("tree-", pass->name, num, NULL);
-      glob_name = concat ("tree-", pass->name, NULL);
-      pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
-                                                TDF_TREE, n + TDI_tree_all, 0);
-    }
+    prefix = "ipa-", flags = TDF_IPA;
+  else if (properties & PROP_trees)
+    prefix = "tree-", flags = TDF_TREE;
   else
-    {
-      flag_name = concat ("rtl-", pass->name, num, NULL);
-      glob_name = concat ("rtl-", pass->name, NULL);
-      pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
-                                                TDF_RTL, n, pass->letter);
-    }
+    prefix = "rtl-", flags = TDF_RTL;
+
+  flag_name = concat (prefix, pass->name, num, NULL);
+  glob_name = concat (prefix, pass->name, NULL);
+  pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
+                                            flags, pass->letter);
 }
 
+/* Recursive worker function for register_dump_files.  */
+
 static int 
-register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties)
+register_dump_files_1 (struct tree_opt_pass *pass, bool ipa, int properties)
 {
-  static int n = 0;
   do
     {
-      int new_properties;
-      int pass_number;
+      int new_properties = (properties | pass->properties_provided)
+                          & ~pass->properties_destroyed;
 
-      pass->properties_required = properties;
-      new_properties =
-        (properties | pass->properties_provided) & ~pass->properties_destroyed;
-
-      /* Reset the counter when we reach RTL-based passes.  */
-      if ((new_properties ^ pass->properties_required) & PROP_rtl)
-        n = 0;
-
-      pass_number = n;
       if (pass->name)
-        n++;
+        register_one_dump_file (pass, ipa, new_properties);
 
       if (pass->sub)
-        new_properties = register_dump_files (pass->sub, false, new_properties);
+        new_properties = register_dump_files_1 (pass->sub, false,
+                                               new_properties);
 
       /* If we have a gate, combine the properties that we could have with
          and without the pass being examined.  */
@@ -371,10 +355,6 @@ register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties)
       else
         properties = new_properties;
 
-      pass->properties_provided = properties;
-      if (pass->name)
-        register_one_dump_file (pass, ipa, pass_number);
-
       pass = pass->next;
     }
   while (pass);
@@ -382,13 +362,25 @@ register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties)
   return properties;
 }
 
+/* Register the dump files for the pipeline starting at PASS.  IPA is
+   true if the pass is inter-procedural, and PROPERTIES reflects the
+   properties that are guarenteed to be available at the beginning of
+   the pipeline.  */
+
+static void 
+register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties)
+{
+  pass->properties_required |= properties;
+  pass->todo_flags_start |= TODO_set_props;
+  register_dump_files_1 (pass, ipa, properties);
+}
+
 /* Add a pass to the pass list. Duplicate the pass if it's already
    in the list.  */
 
 static struct tree_opt_pass **
 next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass)
 {
-
   /* A nonzero static_pass_number indicates that the
      pass is already in the list.  */
   if (pass->static_pass_number)
@@ -699,23 +691,32 @@ init_optimization_passes (void)
 #undef NEXT_PASS
 
   /* Register the passes with the tree dump code.  */
-  register_dump_files (all_ipa_passes, true, PROP_gimple_leh | PROP_cfg);
+  register_dump_files (all_ipa_passes, true,
+                      PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
+                      | PROP_cfg);
   register_dump_files (all_lowering_passes, false, PROP_gimple_any);
-  register_dump_files (all_passes, false, PROP_gimple_leh | PROP_cfg);
+  register_dump_files (all_passes, false,
+                      PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
+                      | PROP_cfg);
 }
 
 static unsigned int last_verified;
+static unsigned int curr_properties;
+
 static void
-execute_todo (struct tree_opt_pass *pass, unsigned int flags, bool use_required)
+execute_todo (unsigned int flags)
 {
-  int properties 
-    = use_required ? pass->properties_required : pass->properties_provided;
-
 #if defined ENABLE_CHECKING
   if (need_ssa_update_p ())
     gcc_assert (flags & TODO_update_ssa_any);
 #endif
 
+  if (curr_properties & PROP_ssa)
+    flags |= TODO_verify_ssa;
+  flags &= ~last_verified;
+  if (!flags)
+    return;
+
   /* Always cleanup the CFG before doing anything else.  */
   if (flags & TODO_cleanup_cfg)
     {
@@ -738,6 +739,7 @@ execute_todo (struct tree_opt_pass *pass, unsigned int flags, bool use_required)
     {
       unsigned update_flags = flags & TODO_update_ssa_any;
       update_ssa (update_flags);
+      last_verified &= ~TODO_verify_ssa;
     }
 
   if (flags & TODO_remove_unused_locals)
@@ -746,19 +748,19 @@ execute_todo (struct tree_opt_pass *pass, unsigned int flags, bool use_required)
   if ((flags & TODO_dump_func)
       && dump_file && current_function_decl)
     {
-      if (properties & PROP_trees)
+      if (curr_properties & PROP_trees)
         dump_function_to_file (current_function_decl,
                                dump_file, dump_flags);
       else
        {
          if (dump_flags & TDF_SLIM)
            print_rtl_slim_with_bb (dump_file, get_insns (), dump_flags);
-         else if (properties & PROP_cfg)
+         else if (curr_properties & PROP_cfg)
            print_rtl_with_bb (dump_file, get_insns ());
           else
            print_rtl (dump_file, get_insns ());
 
-         if (properties & PROP_cfg
+         if (curr_properties & PROP_cfg
              && graph_dump_format != no_graph
              && (dump_flags & TDF_GRAPH))
            print_rtl_graph_with_bb (dump_file_name, get_insns ());
@@ -783,8 +785,7 @@ execute_todo (struct tree_opt_pass *pass, unsigned int flags, bool use_required)
     }
 
 #if defined ENABLE_CHECKING
-  if ((pass->properties_required & PROP_ssa)
-      && !(pass->properties_destroyed & PROP_ssa))
+  if (flags & TODO_verify_ssa)
     verify_ssa (true);
   if (flags & TODO_verify_flow)
     verify_flow_info ();
@@ -793,30 +794,36 @@ execute_todo (struct tree_opt_pass *pass, unsigned int flags, bool use_required)
   if (flags & TODO_verify_loops)
     verify_loop_closed_ssa ();
 #endif
+
+  last_verified = flags & TODO_verify_all;
 }
 
 static bool
 execute_one_pass (struct tree_opt_pass *pass)
 {
-  unsigned int todo; 
+  bool initializing_dump;
 
   /* See if we're supposed to run this pass.  */
   if (pass->gate && !pass->gate ())
     return false;
 
+  if (pass->todo_flags_start & TODO_set_props)
+    curr_properties = pass->properties_required;
+
   /* Note that the folders should only create gimple expressions.
      This is a hack until the new folder is ready.  */
-  in_gimple_form = (pass->properties_provided & PROP_trees) != 0;
+  in_gimple_form = (curr_properties & PROP_trees) != 0;
 
   /* Run pre-pass verification.  */
-  todo = pass->todo_flags_start & ~last_verified;
-  if (todo)
-    execute_todo (pass, todo, true);
+  execute_todo (pass->todo_flags_start);
+
+  gcc_assert ((curr_properties & pass->properties_required)
+             == pass->properties_required);
 
   /* If a dump file name is present, open it if enabled.  */
   if (pass->static_pass_number != -1)
     {
-      bool initializing_dump = !dump_initialized_p (pass->static_pass_number);
+      initializing_dump = !dump_initialized_p (pass->static_pass_number);
       dump_file_name = get_dump_file_name (pass->static_pass_number);
       dump_file = dump_begin (pass->static_pass_number, &dump_flags);
       if (dump_file && current_function_decl)
@@ -832,18 +839,9 @@ execute_one_pass (struct tree_opt_pass *pass)
             ? " (unlikely executed)"
             : "");
        }
-
-      if (initializing_dump
-         && dump_file
-         && graph_dump_format != no_graph
-         && (pass->properties_provided & (PROP_cfg | PROP_rtl))
-             == (PROP_cfg | PROP_rtl))
-       {
-         get_dump_file_info (pass->static_pass_number)->flags |= TDF_GRAPH;
-         dump_flags |= TDF_GRAPH;
-         clean_graph_dump_file (dump_file_name);
-       }
     }
+  else
+    initializing_dump = false;
 
   /* If a timevar is present, start it.  */
   if (pass->tv_id)
@@ -851,17 +849,30 @@ execute_one_pass (struct tree_opt_pass *pass)
 
   /* Do it!  */
   if (pass->execute)
-    pass->execute ();
+    {
+      pass->execute ();
+      last_verified = 0;
+    }
 
   /* Stop timevar.  */
   if (pass->tv_id)
     timevar_pop (pass->tv_id);
 
+  curr_properties = (curr_properties | pass->properties_provided)
+                   & ~pass->properties_destroyed;
+
+  if (initializing_dump
+      && dump_file
+      && graph_dump_format != no_graph
+      && (curr_properties & (PROP_cfg | PROP_rtl)) == (PROP_cfg | PROP_rtl))
+    {
+      get_dump_file_info (pass->static_pass_number)->flags |= TDF_GRAPH;
+      dump_flags |= TDF_GRAPH;
+      clean_graph_dump_file (dump_file_name);
+    }
+
   /* Run post-pass cleanup and verification.  */
-  todo = pass->todo_flags_finish;
-  last_verified = todo & TODO_verify_all;
-  if (todo)
-    execute_todo (pass, todo, false);
+  execute_todo (pass->todo_flags_finish);
 
   /* Flush and close dump file.  */
   if (dump_file_name)
index 80ecced..1211596 100644 (file)
@@ -1,3 +1,16 @@
+2006-02-08  Paolo Bonzini  <bonzini@gnu.org>
+
+       * lib/gcc-dg.exp (cleanup-rtl-dump, cleanup-tree-dump,
+       cleanup-ipa-dump): Update dump file glob patterns.
+       * lib/scantree.exp (scan-tree-dump, scan-tree-dump-times,
+       scan-tree-dump-not, scan-tree-dump-dem): Likewise.
+       * lib/scanipa.exp (scan-ipa-dump, scan-ipa-dump-times,
+       scan-ipa-dump-not, scan-ipa-dump-dem): Likewise.
+
+       * lib/scanrtl.exp: New.
+       * lib/gcc-dg.exp: Load it.
+       * objc.dg/stubify-2.m: Use scan-rtl-dump-not.
+
 2006-02-07  Janis Johnson  <janis187@us.ibm.com>
 
        PR testsuite/26159
index 6a22881..2b668eb 100644 (file)
@@ -1,4 +1,5 @@
-#   Copyright (C) 1997, 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   Copyright (C) 1997, 1999, 2000, 2003, 2004, 2005, 2006
+#   Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,6 +20,7 @@ load_lib file-format.exp
 load_lib target-supports.exp
 load_lib target-supports-dg.exp
 load_lib scanasm.exp
+load_lib scanrtl.exp
 load_lib scantree.exp
 load_lib scanipa.exp
 load_lib prune.exp
@@ -344,21 +346,21 @@ proc cleanup-repo-files { } {
 #
 # SUFFIX is the filename suffix pattern.
 proc cleanup-rtl-dump { suffix } {
-  cleanup-dump "\[0-9\]\*.$suffix"
+  cleanup-dump "\[0-9\]\[0-9\]\[0-9\]r.$suffix"
 }
 
 # Remove a specific tree dump file for the current test.
 #
 # SUFFIX is the tree dump file suffix pattern.
 proc cleanup-tree-dump { suffix } {
-  cleanup-dump "t\[0-9\]\*.$suffix"
+  cleanup-dump "\[0-9\]\[0-9\]\[0-9\]t.$suffix"
 }
 
 # Remove a specific ipa dump file for the current test.
 #
 # SUFFIX is the ipa dump file suffix pattern.
 proc cleanup-ipa-dump { suffix } {
-  cleanup-dump "i\[0-9\]\*.$suffix"
+  cleanup-dump "\[0-9\]\[0-9\]\[0-9\]i.$suffix"
 }
 
 # Remove all dump files with the provided suffix.
index 7f9c031..9ca6e2c 100644 (file)
@@ -36,9 +36,9 @@ proc scan-ipa-dump { args } {
        return
     }
     if { [llength $args] >= 3 } {
-       scan-dump "ipa" [lindex $args 0] "i\[0-9\]\*.[lindex $args 1]" [lindex $args 2]
+       scan-dump "ipa" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" [lindex $args 2]
     } else {
-       scan-dump "ipa" [lindex $args 0] "i\[0-9\]\*.[lindex $args 1]"
+       scan-dump "ipa" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
     }
 }
 
@@ -59,10 +59,10 @@ proc scan-ipa-dump-times { args } {
     }
     if { [llength $args] >= 4 } {
        scan-dump-times "ipa" [lindex $args 0] [lindex $args 1] \
-                       "i\[0-9\]\*.[lindex $args 2]" [lindex $args 3]
+                       "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" [lindex $args 3]
     } else {
        scan-dump-times "ipa" [lindex $args 0] [lindex $args 1] \
-                       "i\[0-9\]\*.[lindex $args 2]"
+                       "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]"
     }
 }
 
@@ -83,10 +83,10 @@ proc scan-ipa-dump-not { args } {
     }
     if { [llength $args] >= 3 } {
        scan-dump-not "ipa" [lindex $args 0] \
-                     "i\[0-9\]\*.[lindex $args 1]" [lindex $args 2]
+                     "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" [lindex $args 2]
     } else {
        scan-dump-not "ipa" [lindex $args 0] \
-                     "i\[0-9\]\*.[lindex $args 1]"
+                     "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
     }
 }
 
@@ -108,10 +108,10 @@ proc scan-ipa-dump-dem { args } {
     }
     if { [llength $args] >= 3 } {
        scan-dump-dem "ipa" [lindex $args 0] \
-                     "i\[0-9\]\*.[lindex $args 1]" [lindex $args 2]
+                     "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" [lindex $args 2]
     } else {
        scan-dump-dem "ipa" [lindex $args 0] \
-                     "i\[0-9\]\*.[lindex $args 1]"
+                     "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
     }
 }
 
@@ -132,10 +132,10 @@ proc scan-ipa-dump-dem-not { args } {
     }
     if { [llength $args] >= 3 } {
        scan-dump-dem-not "ipa" [lindex $args 0] \
-                         "i\[0-9\]\*.[lindex $args 1]" \
+                         "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" \
                          [lindex $args 2]
     } else {
        scan-dump-dem-not "ipa" [lindex $args 0] \
-                         "i\[0-9\]\*.[lindex $args 1]"
+                         "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
     }
 }
index 2a60686..a77ab9f 100644 (file)
@@ -28,4 +28,4 @@ extern int bogonic (int, int, int) ;
 
 /* Any symbol_ref of an un-stubified objc_msgSend is an error; look
    for "objc_msgSend" in quotes, without the $stub suffix.  */
-/* { dg-final { scan-file-not stubify-2.m.08.jump "symbol_ref.*\"objc_msgSend\"" } } */
+/* { dg-final { scan-rtl-dump-not "symbol_ref.*\"objc_msgSend\"" "jump" } } */
index 89fd71c..49862ed 100644 (file)
@@ -721,22 +721,23 @@ dump_node (tree t, int flags, FILE *stream)
 \f
 
 /* Table of tree dump switches. This must be consistent with the
-   TREE_DUMP_INDEX enumeration in tree.h */
+   TREE_DUMP_INDEX enumeration in tree.h */
 static struct dump_file_info dump_files[TDI_end] =
 {
   {NULL, NULL, NULL, 0, 0, 0, 0},
-  {".tu", "translation-unit", NULL, TDF_TREE, 0, 0, 0},
-  {".class", "class-hierarchy", NULL, TDF_TREE, 0, 1, 0},
-  {".original", "tree-original", NULL, TDF_TREE, 0, 2, 0},
-  {".gimple", "tree-gimple", NULL, TDF_TREE, 0, 3, 0},
-  {".nested", "tree-nested", NULL, TDF_TREE, 0, 4, 0},
-  {".inlined", "tree-inlined", NULL, TDF_TREE, 0, 5, 0},
-  {".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6, 0},
+  {".cgraph", "ipa-cgraph", NULL, TDF_IPA, 0,  0, 0},
+  {".tu", "translation-unit", NULL, TDF_TREE, 0, 1, 0},
+  {".class", "class-hierarchy", NULL, TDF_TREE, 0, 2, 0},
+  {".original", "tree-original", NULL, TDF_TREE, 0, 3, 0},
+  {".gimple", "tree-gimple", NULL, TDF_TREE, 0, 4, 0},
+  {".nested", "tree-nested", NULL, TDF_TREE, 0, 5, 0},
+  {".inlined", "tree-inlined", NULL, TDF_TREE, 0, 6, 0},
+  {".vcg", "tree-vcg", NULL, TDF_TREE, 0, 7, 0},
+#define FIRST_AUTO_NUMBERED_DUMP 8
+
   {NULL, "tree-all", NULL, TDF_TREE, 0, 0, 0},
   {NULL, "rtl-all", NULL, TDF_RTL, 0, 0, 0},
   {NULL, "ipa-all", NULL, TDF_IPA, 0, 0, 0},
-
-  { ".cgraph", "ipa-cgraph", NULL,     TDF_IPA, 0,  0, 0},
 };
 
 /* Dynamically registered tree dump files and switches.  */
@@ -772,8 +773,11 @@ static const struct dump_option_value_info dump_options[] =
 
 unsigned int
 dump_register (const char *suffix, const char *swtch, const char *glob,
-              int flags, unsigned int num, int letter)
+              int flags, int letter)
 {
+  static int next_dump = FIRST_AUTO_NUMBERED_DUMP;
+  int num = next_dump++;
+
   size_t this = extra_dump_files_in_use++;
 
   if (this >= extra_dump_files_alloced)
@@ -819,7 +823,7 @@ get_dump_file_info (enum tree_dump_index phase)
 char *
 get_dump_file_name (enum tree_dump_index phase)
 {
-  char dump_id[7];
+  char dump_id[10];
   struct dump_file_info *dfi;
 
   if (phase == TDI_none)
@@ -833,15 +837,15 @@ get_dump_file_name (enum tree_dump_index phase)
     dump_id[0] = '\0';
   else
     {
-      const char *template;
+      char suffix;
       if (dfi->flags & TDF_TREE)
-       template = ".t%02d";
+       suffix = 't';
       else if (dfi->flags & TDF_IPA)
-       template = ".i%02d";
+       suffix = 'i';
       else
-       template = ".%02d";
+       suffix = 'r';
 
-      if (snprintf (dump_id, sizeof (dump_id), template, dfi->num) < 0)
+      if (snprintf (dump_id, sizeof (dump_id), ".%03d%c", dfi->num, suffix) < 0)
        dump_id[0] = '\0';
     }
 
index 00b1440..398faf5 100644 (file)
@@ -95,6 +95,7 @@ extern void debug_function (tree, int);
 extern int dump_flag (dump_info_p, int, tree);
 
 extern unsigned int dump_register (const char *, const char *, const char *, 
-                                  int, unsigned int, int);
+                                  int, int);
+
 
 #endif /* ! GCC_TREE_DUMP_H */
index dfb3a27..85379e6 100644 (file)
@@ -1700,7 +1700,7 @@ struct tree_opt_pass pass_lower_eh =
   TV_TREE_EH,                          /* tv_id */
   PROP_gimple_lcf,                     /* properties_required */
   PROP_gimple_leh,                     /* properties_provided */
-  PROP_gimple_lcf,                     /* properties_destroyed */
+  0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
   TODO_dump_func,                      /* todo_flags_finish */
   0                                    /* letter */
index 82e8c10..5d49b6c 100644 (file)
@@ -30,6 +30,7 @@ Boston, MA 02110-1301, USA.  */
 enum tree_dump_index
 {
   TDI_none,                    /* No dump */
+  TDI_cgraph,                   /* dump function call graph.  */
   TDI_tu,                      /* dump the whole translation unit.  */
   TDI_class,                   /* dump class hierarchy.  */
   TDI_original,                        /* dump each function before optimizing it */
@@ -43,7 +44,6 @@ enum tree_dump_index
   TDI_rtl_all,                  /* enable all the RTL dumps.  */
   TDI_ipa_all,                  /* enable all the IPA dumps.  */
 
-  TDI_cgraph,                   /* dump function call graph.  */
   TDI_end
 };
 
@@ -154,7 +154,7 @@ struct dump_file_info
 #define PROP_gimple_lomp       (1 << 10)       /* lowered OpenMP directives */
 
 #define PROP_trees \
-  (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh)
+  (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp)
 
 /* To-do flags.  */
 #define TODO_dump_func                 (1 << 0)
@@ -208,6 +208,10 @@ struct dump_file_info
    the memory footprint for VAR_DECLs.  */
 #define TODO_remove_unused_locals      (1 << 11)
 
+/* Internally used for the first in a sequence of passes.  It is set
+   for the passes that are handed to register_dump_files.  */
+#define TODO_set_props                 (1 << 12)
+
 #define TODO_update_ssa_any            \
     (TODO_update_ssa                   \
      | TODO_update_ssa_no_phi          \