diff mbox

[google] Backport r174536,174537,174762,174698 to google/main (issue4568059)

Message ID 20110607223810.0E65520DA7@syzygy.mtv.corp.google.com
State New
Headers show

Commit Message

Xinliang David Li June 7, 2011, 10:38 p.m. UTC
2011-06-07  David Li  <davidxl@google.com>
	Backport trunk r174536,174537,174762,174698



--
This patch is available for review at http://codereview.appspot.com/4568059
diff mbox

Patch

Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi	(revision 174725)
+++ doc/invoke.texi	(working copy)
@@ -5217,11 +5217,12 @@  appended with a sequential number starti
 Disable rtl pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
 statically invoked in the compiler multiple times, the pass name should be
 appended with a sequential number starting from 1.  @var{range-list} is a comma
-seperated list of function ranges.  Each range is a number pair seperated by a colon.
-The range is inclusive in both ends.  If the range is trivial, the number pair can be
-simplified a a single number.  If the function's cgraph node's @var{uid} is falling
-within one of the specified ranges, the @var{pass} is disabled for that function.
-The @var{uid} is shown in the function header of a dump file.
+seperated list of function ranges or assembler names.  Each range is a number
+pair seperated by a colon.  The range is inclusive in both ends.  If the range
+is trivial, the number pair can be simplified as a single number.  If the
+function's cgraph node's @var{uid} is falling within one of the specified ranges,
+the @var{pass} is disabled for that function.  The @var{uid} is shown in the
+function header of a dump file.
 
 @item -fdisable-tree-@var{pass}
 @item -fdisable-tree-@var{pass}=@var{range-list}
@@ -5251,7 +5252,8 @@  of option arguments.
    -fenable-tree-cunroll=1
 # disable gcse2 for functions at the following ranges [1,1],
 # [300,400], and [400,1000]
-   -fdisable-rtl-gcse2=1:100,300,400:1000
+# disable gcse2 for functions foo and foo2
+   -fdisable-rtl-gcse2=foo,foo2
 # disable early inlining
    -fdisable-tree-einline
 # disable ipa inlining
Index: tree-pretty-print.c
===================================================================
--- tree-pretty-print.c	(revision 174725)
+++ tree-pretty-print.c	(working copy)
@@ -3015,3 +3015,40 @@  pp_base_tree_identifier (pretty_printer 
     pp_append_text (pp, IDENTIFIER_POINTER (id),
 		    IDENTIFIER_POINTER (id) + IDENTIFIER_LENGTH (id));
 }
+
+/* A helper function that is used to dump function information before the
+   function dump.  */
+
+void
+dump_function_header (FILE *dump_file, tree fdecl, int flags)
+{
+  const char *dname, *aname;
+  struct cgraph_node *node = cgraph_get_node (fdecl);
+  struct function *fun = DECL_STRUCT_FUNCTION (fdecl);
+
+  dname = lang_hooks.decl_printable_name (fdecl, 2);
+
+  if (DECL_ASSEMBLER_NAME_SET_P (fdecl))
+    aname = (IDENTIFIER_POINTER
+             (DECL_ASSEMBLER_NAME (fdecl)));
+  else
+    aname = "<unset-asm-name>";
+
+  fprintf (dump_file, "\n;; Function %s (%s, funcdef_no=%d",
+	   dname, aname, fun->funcdef_no);
+  if (!(flags & TDF_NOUID))
+    fprintf (dump_file, ", decl_uid=%d", DECL_UID (fdecl));
+  if (node)
+    {
+      fprintf (dump_file, ", cgraph_uid=%d)%s\n\n", node->uid,
+               node->frequency == NODE_FREQUENCY_HOT
+               ? " (hot)"
+               : node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED
+               ? " (unlikely executed)"
+               : node->frequency == NODE_FREQUENCY_EXECUTED_ONCE
+               ? " (executed once)"
+               : "");
+    }
+  else
+    fprintf (dump_file, ")\n\n");
+}
Index: tree-pretty-print.h
===================================================================
--- tree-pretty-print.h	(revision 174725)
+++ tree-pretty-print.h	(working copy)
@@ -50,6 +50,7 @@  extern void debug_generic_expr (tree);
 extern void debug_generic_stmt (tree);
 extern void debug_tree_chain (tree);
 extern void percent_K_format (text_info *);
+extern void dump_function_header (FILE *, tree, int);
 
 /* In toplev.c  */
 extern bool default_tree_printer (pretty_printer *, text_info *, const char *,
Index: ChangeLog.google-main
===================================================================
--- ChangeLog.google-main	(revision 174725)
+++ ChangeLog.google-main	(working copy)
@@ -1,3 +1,25 @@ 
+2011-06-07  David Li  <davidxl@google.com>
+
+	Backport trunk r174536,174537,174762,174698
+
+	* passes.c (enable_disable_pass): Handle assembler name.
+	(is_pass_explicitly_enabled_or_disabled): Ditto.
+	* predict.c : Change pass name
+	* ipa.c: Ditto.
+	* dce.c: Ditto.
+	* tree-profile.c: Ditto.
+	* except.c: Ditto.
+	* tree-pretty-print.c (dump_function_header): New function.
+	* final.c (rest_of_clean_state): Use header dumper.
+	* tree-cfg.c (gimple_dump_cfg): Use header dumper.
+	* passes.c (pass_init_dump_file): Use header dumper.
+	* tree-pretty-print.c (dump_function_header): Add flags.
+	Don't dump decl_uid with nouid.
+	* tree-pretty-print.h (dump_function_header): Adjust.
+	* final.c (rest_of_clean_state): Pass dump_flags on, with nouid.
+	* passes.c (pass_init_dump_file): Pass dump_flags on.
+	* tree-cfg.c (gimple_dump_cfg): Pass flags on.
+
 2011-06-06  Diego Novillo  <dnovillo@google.com>
 
 	Merge from google/integration rev 174705.
Index: final.c
===================================================================
--- final.c	(revision 174725)
+++ final.c	(working copy)
@@ -82,6 +82,7 @@  along with GCC; see the file COPYING3.  
 #include "ggc.h"
 #include "cfgloop.h"
 #include "params.h"
+#include "tree-pretty-print.h"
 
 #ifdef XCOFF_DEBUGGING_INFO
 #include "xcoffout.h"		/* Needed for external data
@@ -4456,23 +4457,11 @@  rest_of_clean_state (void)
 	}
       else
 	{
-	  const char *aname;
-	  struct cgraph_node *node = cgraph_node (current_function_decl);
-
-	  aname = (IDENTIFIER_POINTER
-		   (DECL_ASSEMBLER_NAME (current_function_decl)));
-	  fprintf (final_output, "\n;; Function (%s) %s\n\n", aname,
-	     node->frequency == NODE_FREQUENCY_HOT
-	     ? " (hot)"
-	     : node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED
-	     ? " (unlikely executed)"
-	     : node->frequency == NODE_FREQUENCY_EXECUTED_ONCE
-	     ? " (executed once)"
-	     : "");
-
 	  flag_dump_noaddr = flag_dump_unnumbered = 1;
 	  if (flag_compare_debug_opt || flag_compare_debug)
 	    dump_flags |= TDF_NOUID;
+	  dump_function_header (final_output, current_function_decl,
+				dump_flags);
 	  final_insns_dump_p = true;
 
 	  for (insn = get_insns (); insn; insn = NEXT_INSN (insn))

Property changes on: testsuite/gcc.target/powerpc/ppc-round.c
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk/gcc/testsuite/gcc.target/powerpc/ppc-round.c:r174536-174537,174698,174762

Index: testsuite/gcc.dg/profile-dir-1.c
===================================================================
--- testsuite/gcc.dg/profile-dir-1.c	(revision 174725)
+++ testsuite/gcc.dg/profile-dir-1.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O -fprofile-generate=. -fdump-ipa-tree_profile_ipa" } */
-/* { dg-final { scan-ipa-dump " ./profile-dir-1.gcda" "tree_profile_ipa" } } */
+/* { dg-options "-O -fprofile-generate=. -fdump-ipa-profile" } */
+/* { dg-final { scan-ipa-dump " ./profile-dir-1.gcda" "profile" } } */
 
 int
 main(void)
@@ -8,4 +8,4 @@  main(void)
   return 0;
 }
 
-/* { dg-final { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/profile-dir-2.c
===================================================================
--- testsuite/gcc.dg/profile-dir-2.c	(revision 174725)
+++ testsuite/gcc.dg/profile-dir-2.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O -fprofile-generate -fdump-ipa-tree_profile_ipa" } */
-/* { dg-final { scan-ipa-dump "/profile-dir-2.gcda" "tree_profile_ipa" } } */
+/* { dg-options "-O -fprofile-generate -fdump-ipa-profile" } */
+/* { dg-final { scan-ipa-dump "/profile-dir-2.gcda" "profile" } } */
 
 int
 main(void)
@@ -8,4 +8,4 @@  main(void)
   return 0;
 }
 
-/* { dg-final { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-ssa/dump-1.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/dump-1.c	(revision 174725)
+++ testsuite/gcc.dg/tree-ssa/dump-1.c	(working copy)
@@ -1,9 +1,9 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-profile-details" } */
+/* { dg-options "-O1 -fdump-tree-profile_estimate-details" } */
 
 int f(void)
 {
   return 0;
 }
 
-/* { dg-final { cleanup-tree-dump "profile" } } */
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
Index: testsuite/gcc.dg/tree-ssa/loop-25.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/loop-25.c	(revision 174725)
+++ testsuite/gcc.dg/tree-ssa/loop-25.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-profile" } */
+/* { dg-options "-O1 -fdump-tree-profile_estimate" } */
 
 int foo(void);
 void bla(void);
@@ -118,12 +118,12 @@  void test5 (void)
     }
 }
 
-/* { dg-final { scan-tree-dump-times "Disambiguating loop" 5 "profile" } } */
+/* { dg-final { scan-tree-dump-times "Disambiguating loop" 5 "profile_estimate" } } */
 /* For the following xfail marks, see PR35629.  */
-/* { dg-final { scan-tree-dump-times "Found latch edge" 5 "profile" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Merged latch edges" 2 "profile" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "4 loops found" 2 "profile" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "3 loops found" 2 "profile" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "2 loops found" 1 "profile" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Found latch edge" 5 "profile_estimate" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Merged latch edges" 2 "profile_estimate" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "4 loops found" 2 "profile_estimate" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "3 loops found" 2 "profile_estimate" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "2 loops found" 1 "profile_estimate" { xfail *-*-* } } } */
 
-/* { dg-final { cleanup-tree-dump "profile" } } */
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
Index: testsuite/gcc.dg/tree-prof/stringop-1.c
===================================================================
--- testsuite/gcc.dg/tree-prof/stringop-1.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/stringop-1.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-tree_profile_ipa" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
 int a[1000];
 int b[1000];
 int size=1;
@@ -13,10 +13,10 @@  main()
     }
    return 0;
 }
-/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "tree_profile_ipa"} } */
+/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "profile"} } */
 /* Really this ought to simplify into assignment, but we are not there yet.  */
 /* a[0] = b[0] is what we fold the resulting memcpy into.  */
 /* { dg-final-use { scan-tree-dump " = MEM.*&b" "optimized"} } */
 /* { dg-final-use { scan-tree-dump "MEM.*&a\\\] = " "optimized"} } */
 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-prof/update-loopch.c
===================================================================
--- testsuite/gcc.dg/tree-prof/update-loopch.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/update-loopch.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-ipa-tree_profile_ipa-blocks -fdump-tree-optimized-blocks" } */
+/* { dg-options "-O2 -fdump-ipa-profile-blocks -fdump-tree-optimized-blocks" } */
 int max = 33333;
 int a[8];
 int
@@ -14,8 +14,8 @@  main ()
 /* Loop header copying will peel away the initial conditional, so the loop body
    is once reached directly from entry point of function, rest via loopback
    edge.  */
-/* { dg-final-use { scan-ipa-dump "count:33333" "tree_profile_ipa"} } */
+/* { dg-final-use { scan-ipa-dump "count:33333" "profile"} } */
 /* { dg-final-use { scan-tree-dump "count:33332" "optimized"} } */
 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
Index: testsuite/gcc.dg/tree-prof/stringop-2.c
===================================================================
--- testsuite/gcc.dg/tree-prof/stringop-2.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/stringop-2.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-tree_profile_ipa" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
 int a[1000];
 int b[1000];
 int size=1;
@@ -13,8 +13,8 @@  main()
     }
    return 0;
 }
-/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "tree_profile_ipa"} } */
+/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "profile"} } */
 /* The versioned memset of size 4 should be optimized to an assignment.  */
 /* { dg-final-use { scan-tree-dump "a\\\[0\\\] = 168430090" "optimized"} } */
 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-prof/ic-misattribution-1.c
===================================================================
--- testsuite/gcc.dg/tree-prof/ic-misattribution-1.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/ic-misattribution-1.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-ipa-tree_profile_ipa" } */
+/* { dg-options "-O2 -fdump-ipa-profile" } */
 /* { dg-additional-sources "ic-misattribution-1a.c" } */
 
 extern void other_caller (void);
@@ -15,5 +15,5 @@  caller(void (*func) (void))
   func ();
 }
 
-/* { dg-final-use { scan-ipa-dump "hist->count 1 hist->all 1" "tree_profile_ipa" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { scan-ipa-dump "hist->count 1 hist->all 1" "profile" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c
===================================================================
--- testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c	(working copy)
@@ -19,4 +19,4 @@  main ()
   return 0;
 }
 
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-prof/indir-call-prof.c
===================================================================
--- testsuite/gcc.dg/tree-prof/indir-call-prof.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/indir-call-prof.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-tree_profile_ipa" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
 
 static int a1 (void)
 {
@@ -37,7 +37,7 @@  main (void)
   return 0;
 }
 
-/* { dg-final-use { scan-ipa-dump "Indirect call -> direct call.* a1 transformation on insn" "tree_profile_ipa"} } */
+/* { dg-final-use { scan-ipa-dump "Indirect call -> direct call.* a1 transformation on insn" "profile"} } */
 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-prof/val-prof-1.c
===================================================================
--- testsuite/gcc.dg/tree-prof/val-prof-1.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/val-prof-1.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-tree_profile_ipa" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
 int a[1000];
 int b = 256;
 int c = 257;
@@ -15,8 +15,8 @@  main ()
     }
   return 0;
 }
-/* { dg-final-use { scan-ipa-dump "Div.mod by constant n_\[0-9\]*=257 transformation on insn" "tree_profile_ipa"} } */
+/* { dg-final-use { scan-ipa-dump "Div.mod by constant n_\[0-9\]*=257 transformation on insn" "profile"} } */
 /* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* != 257\\)" "optimized"} } */
 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-prof/val-prof-2.c
===================================================================
--- testsuite/gcc.dg/tree-prof/val-prof-2.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/val-prof-2.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-tree_profile_ipa" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
 unsigned int a[1000];
 unsigned int b = 256;
 unsigned int c = 1024;
@@ -23,10 +23,10 @@  main ()
     }
   return 0;
 }
-/* { dg-final-use { scan-ipa-dump "Mod power of 2 transformation on insn" "tree_profile_ipa" } } */
+/* { dg-final-use { scan-ipa-dump "Mod power of 2 transformation on insn" "profile" } } */
 /* This is part of code checking that n is power of 2, so we are sure that the transformation
    didn't get optimized out.  */
 /* { dg-final-use { scan-tree-dump "n_\[0-9\]* \\+ 0xffff" "optimized"} } */
 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-prof/val-prof-3.c
===================================================================
--- testsuite/gcc.dg/tree-prof/val-prof-3.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/val-prof-3.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-tree_profile_ipa" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
 unsigned int a[1000];
 unsigned int b = 257;
 unsigned int c = 1023;
@@ -23,10 +23,10 @@  main ()
     }
   return 0;
 }
-/* { dg-final-use { scan-ipa-dump "Mod subtract transformation on insn" "tree_profile_ipa" } } */
+/* { dg-final-use { scan-ipa-dump "Mod subtract transformation on insn" "profile" } } */
 /* This is part of code checking that n is greater than the divisor so we are sure that it
    didn't get optimized out.  */
 /* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* \\>" "optimized"} } */
 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-prof/val-prof-4.c
===================================================================
--- testsuite/gcc.dg/tree-prof/val-prof-4.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/val-prof-4.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-tree_profile_ipa" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
 unsigned int a[1000];
 unsigned int b = 999;
 unsigned int c = 1002;
@@ -23,10 +23,10 @@  main ()
     }
   return 0;
 }
-/* { dg-final-use { scan-ipa-dump "Mod subtract transformation on insn" "tree_profile_ipa" } } */
+/* { dg-final-use { scan-ipa-dump "Mod subtract transformation on insn" "profile" } } */
 /* This is part of code checking that n is greater than the divisor so we are sure that it
    didn't get optimized out.  */
 /* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* \\>" "optimized"} } */
 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-prof/val-prof-5.c
===================================================================
--- testsuite/gcc.dg/tree-prof/val-prof-5.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/val-prof-5.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-tree_profile_ipa" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
 int a[1000];
 int b=997;
 main()
@@ -11,7 +11,7 @@  main()
 			a[i]/=b;
 	return 0;
 }
-/* { dg-final-use { scan-ipa-dump "Div.mod by constant b.*=997 transformation on insn" "tree_profile_ipa" } } */
+/* { dg-final-use { scan-ipa-dump "Div.mod by constant b.*=997 transformation on insn" "profile" } } */
 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/tree-prof/val-prof-7.c
===================================================================
--- testsuite/gcc.dg/tree-prof/val-prof-7.c	(revision 174725)
+++ testsuite/gcc.dg/tree-prof/val-prof-7.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-ipa-tree_profile_ipa -mtune=core2" } */
+/* { dg-options "-O2 -fdump-ipa-profile -mtune=core2" } */
 /* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
 
 #include <strings.h>
@@ -22,5 +22,5 @@  int main() {
   return 0;
 }
 
-/* { dg-final-use { scan-ipa-dump "Single value 8 stringop transformation on bzero" "tree_profile_ipa" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { scan-ipa-dump "Single value 8 stringop transformation on bzero" "profile" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: testsuite/gcc.dg/profile-dir-3.c
===================================================================
--- testsuite/gcc.dg/profile-dir-3.c	(revision 174725)
+++ testsuite/gcc.dg/profile-dir-3.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O -fprofile-generate -fprofile-dir=. -fdump-ipa-tree_profile_ipa" } */
-/* { dg-final { scan-ipa-dump " ./profile-dir-3.gcda" "tree_profile_ipa" } } */
+/* { dg-options "-O -fprofile-generate -fprofile-dir=. -fdump-ipa-profile" } */
+/* { dg-final { scan-ipa-dump " ./profile-dir-3.gcda" "profile" } } */
 
 int
 main(void)
@@ -8,4 +8,4 @@  main(void)
   return 0;
 }
 
-/* { dg-final { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final { cleanup-ipa-dump "profile" } } */
Index: testsuite/g++.dg/tree-prof/indir-call-prof.C
===================================================================
--- testsuite/g++.dg/tree-prof/indir-call-prof.C	(revision 174725)
+++ testsuite/g++.dg/tree-prof/indir-call-prof.C	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-tree_profile_ipa" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
 
 struct A {
   A () {}
@@ -33,7 +33,7 @@  main (void)
   return 0;
 }
 
-/* { dg-final-use { scan-ipa-dump "Indirect call -> direct call.* AA transformation on insn" "tree_profile_ipa" } } */
+/* { dg-final-use { scan-ipa-dump "Indirect call -> direct call.* AA transformation on insn" "profile" } } */
 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized" } } */
 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
-/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
Index: predict.c
===================================================================
--- predict.c	(revision 174725)
+++ predict.c	(working copy)
@@ -2289,7 +2289,7 @@  struct gimple_opt_pass pass_profile =
 {
  {
   GIMPLE_PASS,
-  "profile",				/* name */
+  "profile_estimate",			/* name */
   gate_estimate_probability,		/* gate */
   tree_estimate_probability_driver,	/* execute */
   NULL,					/* sub */
Index: ipa.c
===================================================================
--- ipa.c	(revision 174725)
+++ ipa.c	(working copy)
@@ -1535,7 +1535,7 @@  struct ipa_opt_pass_d pass_ipa_profile =
 {
  {
   IPA_PASS,
-  "ipa-profile",			/* name */
+  "profile_estimate",			/* name */
   gate_ipa_profile,			/* gate */
   ipa_profile,			        /* execute */
   NULL,					/* sub */
Index: except.c
===================================================================
--- except.c	(revision 174725)
+++ except.c	(working copy)
@@ -1458,7 +1458,7 @@  struct rtl_opt_pass pass_rtl_eh =
 {
  {
   RTL_PASS,
-  "rtl eh",                             /* name */
+  "rtl_eh",                             /* name */
   gate_handle_eh,                       /* gate */
   rest_of_handle_eh,			/* execute */
   NULL,                                 /* sub */
Index: tree-profile.c
===================================================================
--- tree-profile.c	(revision 174725)
+++ tree-profile.c	(working copy)
@@ -1549,7 +1549,7 @@  struct simple_ipa_opt_pass pass_ipa_tree
 {
  {
   SIMPLE_IPA_PASS,
-  "tree_profile_ipa",                  /* name */
+  "profile",  		               /* name */
   gate_tree_profile_ipa,               /* gate */
   tree_profiling,                      /* execute */
   NULL,                                /* sub */
Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 174725)
+++ tree-cfg.c	(working copy)
@@ -2090,11 +2090,7 @@  gimple_dump_cfg (FILE *file, int flags)
 {
   if (flags & TDF_DETAILS)
     {
-      const char *funcname
-	= lang_hooks.decl_printable_name (current_function_decl, 2);
-
-      fputc ('\n', file);
-      fprintf (file, ";; Function %s\n\n", funcname);
+      dump_function_header (file, current_function_decl, flags);
       fprintf (file, ";; \n%d basic blocks, %d edges, last basic block %d.\n\n",
 	       n_basic_blocks, n_edges, last_basic_block);
 
Index: passes.c
===================================================================
--- passes.c	(revision 174725)
+++ passes.c	(working copy)
@@ -74,6 +74,7 @@  along with GCC; see the file COPYING3.  
 #include "lto-streamer.h"
 #include "plugin.h"
 #include "l-ipo.h"
+#include "tree-pretty-print.h"
 
 #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
 #include "dwarf2out.h"
@@ -537,6 +538,7 @@  struct uid_range
 {
   unsigned int start;
   unsigned int last;
+  const char *assem_name;
   struct uid_range *next;
 };
 
@@ -548,6 +550,7 @@  DEF_VEC_ALLOC_P(uid_range_p, heap);
 static VEC(uid_range_p, heap) *enabled_pass_uid_range_tab = NULL;
 static VEC(uid_range_p, heap) *disabled_pass_uid_range_tab = NULL;
 
+
 /* Parse option string for -fdisable- and -fenable-
    The syntax of the options:
 
@@ -634,6 +637,7 @@  enable_disable_pass (const char *arg, bo
 	  uid_range_p new_range;
 	  char *invalid = NULL;
 	  long start;
+	  char *func_name = NULL;
 
 	  next_range = strchr (one_range, ',');
 	  if (next_range)
@@ -651,17 +655,31 @@  enable_disable_pass (const char *arg, bo
 	  start = strtol (one_range, &invalid, 10);
 	  if (*invalid || start < 0)
 	    {
-	      error ("Invalid range %s in option %s",
-		     one_range,
-		     is_enable ? "-fenable" : "-fdisable");
-	      free (argstr);
-	      return;
+              if (end_val || (one_range[0] >= '0'
+			      && one_range[0] <= '9'))
+                {
+                  error ("Invalid range %s in option %s",
+                         one_range,
+                         is_enable ? "-fenable" : "-fdisable");
+                  free (argstr);
+                  return;
+                }
+	      func_name = one_range;
 	    }
 	  if (!end_val)
 	    {
 	      new_range = XCNEW (struct uid_range);
-	      new_range->start = (unsigned) start;
-	      new_range->last = (unsigned) start;
+              if (!func_name)
+                {
+                  new_range->start = (unsigned) start;
+                  new_range->last = (unsigned) start;
+                }
+              else
+                {
+                  new_range->start = (unsigned) -1;
+                  new_range->last = (unsigned) -1;
+                  new_range->assem_name = xstrdup (func_name);
+                }
 	    }
 	  else
 	    {
@@ -683,15 +701,28 @@  enable_disable_pass (const char *arg, bo
           new_range->next = slot;
           VEC_replace (uid_range_p, *tab, pass->static_pass_number,
                        new_range);
-
           if (is_enable)
-            inform (UNKNOWN_LOCATION,
-                    "enable pass %s for functions in the range of [%u, %u]",
-                    phase_name, new_range->start, new_range->last);
+            {
+              if (new_range->assem_name)
+                inform (UNKNOWN_LOCATION,
+                        "enable pass %s for function %s",
+                        phase_name, new_range->assem_name);
+              else
+                inform (UNKNOWN_LOCATION,
+                        "enable pass %s for functions in the range of [%u, %u]",
+                        phase_name, new_range->start, new_range->last);
+            }
           else
-            inform (UNKNOWN_LOCATION,
-                    "disable pass %s for functions in the range of [%u, %u]",
-                    phase_name, new_range->start, new_range->last);
+            {
+              if (new_range->assem_name)
+                inform (UNKNOWN_LOCATION,
+                        "disable pass %s for function %s",
+                        phase_name, new_range->assem_name);
+              else
+                inform (UNKNOWN_LOCATION,
+                        "disable pass %s for functions in the range of [%u, %u]",
+                        phase_name, new_range->start, new_range->last);
+            }
 
 	  one_range = next_range;
 	} while (next_range);
@@ -725,6 +756,7 @@  is_pass_explicitly_enabled_or_disabled (
 {
   uid_range_p slot, range;
   int cgraph_uid;
+  const char *aname = NULL;
 
   if (!tab
       || (unsigned) pass->static_pass_number >= VEC_length (uid_range_p, tab)
@@ -736,6 +768,8 @@  is_pass_explicitly_enabled_or_disabled (
     return false;
 
   cgraph_uid = func ? cgraph_get_node (func)->uid : 0;
+  if (func && DECL_ASSEMBLER_NAME_SET_P (func))
+    aname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (func));
 
   range = slot;
   while (range)
@@ -743,6 +777,9 @@  is_pass_explicitly_enabled_or_disabled (
       if ((unsigned) cgraph_uid >= range->start
 	  && (unsigned) cgraph_uid <= range->last)
 	return true;
+      if (range->assem_name && aname
+          && !strcmp (range->assem_name, aname))
+        return true;
       range = range->next;
     }
 
@@ -1657,26 +1694,7 @@  pass_init_dump_file (struct opt_pass *pa
       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)
-	{
-	  const char *dname, *aname;
-	  struct cgraph_node *node = cgraph_node (current_function_decl);
-	  dname = lang_hooks.decl_printable_name (current_function_decl, 2);
-	  aname = (IDENTIFIER_POINTER
-		   (DECL_ASSEMBLER_NAME (current_function_decl)));
-	  if (L_IPO_COMP_MODE)
-	    fprintf (dump_file, "\n;; Function %s (%s)[%d:%d]", dname, aname,
-		     FUNC_DECL_MODULE_ID (cfun), FUNC_DECL_FUNC_ID (cfun));
-	  else
-	    fprintf (dump_file, "\n;; Function %s (%s)", dname, aname);
-	  fprintf (dump_file, "%s\n\n",
-	     node->frequency == NODE_FREQUENCY_HOT
-	     ? " (hot)"
-	     : node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED
-	     ? " (unlikely executed)"
-	     : node->frequency == NODE_FREQUENCY_EXECUTED_ONCE
-	     ? " (executed once)"
-	     : "");
-	}
+        dump_function_header (dump_file, current_function_decl, dump_flags);
       return initializing_dump;
     }
   else
Index: dce.c
===================================================================
--- dce.c	(revision 174725)
+++ dce.c	(working copy)
@@ -734,7 +734,7 @@  struct rtl_opt_pass pass_ud_rtl_dce =
 {
  {
   RTL_PASS,
-  "ud dce",                             /* name */
+  "ud_dce",                             /* name */
   gate_ud_dce,                          /* gate */
   rest_of_handle_ud_dce,                /* execute */
   NULL,                                 /* sub */
@@ -1086,7 +1086,7 @@  struct rtl_opt_pass pass_fast_rtl_dce =
 {
  {
   RTL_PASS,
-  "rtl dce",                            /* name */
+  "rtl_dce",                            /* name */
   gate_fast_dce,                        /* gate */
   rest_of_handle_fast_dce,              /* execute */
   NULL,                                 /* sub */