diff --git a/gcc/hard-reg-set.h b/gcc/hard-reg-set.h
index b0bb9bce074..81bca6df0e5 100644
--- a/gcc/hard-reg-set.h
+++ b/gcc/hard-reg-set.h
@@ -524,4 +524,7 @@ call_used_or_fixed_reg_p (unsigned int regno)
 }
 #endif
 
+/* ira-color.cc */
+extern void print_hard_reg_set (FILE *, HARD_REG_SET, const char *, bool);
+
 #endif /* ! GCC_HARD_REG_SET_H */
diff --git a/gcc/ira-color.cc b/gcc/ira-color.cc
index f2e8ea34152..43564b44933 100644
--- a/gcc/ira-color.cc
+++ b/gcc/ira-color.cc
@@ -482,11 +482,14 @@ first_common_ancestor_node (allocno_hard_regs_node_t first,
 }
 
 /* Print hard reg set SET to F.  */
-static void
-print_hard_reg_set (FILE *f, HARD_REG_SET set, bool new_line_p)
+void
+print_hard_reg_set (FILE *f, HARD_REG_SET set,
+		    const char *title, bool new_line_p)
 {
   int i, start, end;
 
+  if (title)
+    fprintf (f, "%s", title);
   for (start = end = -1, i = 0; i < FIRST_PSEUDO_REGISTER; i++)
     {
       bool reg_included = TEST_HARD_REG_BIT (set, i);
@@ -516,7 +519,7 @@ print_hard_reg_set (FILE *f, HARD_REG_SET set, bool new_line_p)
 DEBUG_FUNCTION void
 debug_hard_reg_set (HARD_REG_SET set)
 {
-  print_hard_reg_set (stderr, set, true);
+  print_hard_reg_set (stderr, set, NULL, true);
 }
 
 /* Print allocno hard register subforest given by ROOTS and its LEVEL
@@ -534,7 +537,7 @@ print_hard_regs_subforest (FILE *f, allocno_hard_regs_node_t roots,
       for (i = 0; i < level * 2; i++)
 	fprintf (f, " ");
       fprintf (f, "%d:(", node->preorder_num);
-      print_hard_reg_set (f, node->hard_regs->set, false);
+      print_hard_reg_set (f, node->hard_regs->set, NULL, false);
       fprintf (f, ")@%" PRId64"\n", node->hard_regs->cost);
       print_hard_regs_subforest (f, node->first, level + 1);
     }
@@ -2982,12 +2985,12 @@ setup_allocno_available_regs_num (ira_allocno_t a)
      "      Allocno a%dr%d of %s(%d) has %d avail. regs ",
      ALLOCNO_NUM (a), ALLOCNO_REGNO (a),
      reg_class_names[aclass], ira_class_hard_regs_num[aclass], n);
-  print_hard_reg_set (ira_dump_file, data->profitable_hard_regs, false);
+  print_hard_reg_set (ira_dump_file, data->profitable_hard_regs, NULL, false);
   fprintf (ira_dump_file, ", %snode: ",
 	   data->profitable_hard_regs == data->hard_regs_node->hard_regs->set
 	   ? "" : "^");
   print_hard_reg_set (ira_dump_file,
-		      data->hard_regs_node->hard_regs->set, false);
+		      data->hard_regs_node->hard_regs->set, NULL, false);
   for (i = 0; i < nwords; i++)
     {
       ira_object_t obj = ALLOCNO_OBJECT (a, i);
@@ -3000,7 +3003,7 @@ setup_allocno_available_regs_num (ira_allocno_t a)
 	}
       fprintf (ira_dump_file, " (confl regs = ");
       print_hard_reg_set (ira_dump_file, OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
-			  false);
+			  NULL, false);
       fprintf (ira_dump_file, ")");
     }
   fprintf (ira_dump_file, "\n");
diff --git a/gcc/ira-conflicts.cc b/gcc/ira-conflicts.cc
index a4d93c8d734..69806b1a15b 100644
--- a/gcc/ira-conflicts.cc
+++ b/gcc/ira-conflicts.cc
@@ -670,37 +670,6 @@ build_conflicts (void)
 
 
 
-/* Print hard reg set SET with TITLE to FILE.  */
-static void
-print_hard_reg_set (FILE *file, const char *title, HARD_REG_SET set)
-{
-  int i, start, end;
-
-  fputs (title, file);
-  for (start = end = -1, i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-    {
-      bool reg_included = TEST_HARD_REG_BIT (set, i);
-
-      if (reg_included)
-	{
-	  if (start == -1)
-	    start = i;
-	  end = i;
-	}
-      if (start >= 0 && (!reg_included || i == FIRST_PSEUDO_REGISTER - 1))
-	{
-	  if (start == end)
-	    fprintf (file, " %d", start);
-	  else if (start == end + 1)
-	    fprintf (file, " %d %d", start, end);
-	  else
-	    fprintf (file, " %d-%d", start, end);
-	  start = -1;
-	}
-    }
-  putc ('\n', file);
-}
-
 static void
 print_allocno_conflicts (FILE * file, bool reg_p, ira_allocno_t a)
 {
@@ -759,14 +728,14 @@ print_allocno_conflicts (FILE * file, bool reg_p, ira_allocno_t a)
       conflicting_hard_regs = (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj)
 			       & ~ira_no_alloc_regs
 			       & reg_class_contents[ALLOCNO_CLASS (a)]);
-      print_hard_reg_set (file, "\n;;     total conflict hard regs:",
-			  conflicting_hard_regs);
+      print_hard_reg_set (file, conflicting_hard_regs,
+			  "\n;;     total conflict hard regs:", true);
 
       conflicting_hard_regs = (OBJECT_CONFLICT_HARD_REGS (obj)
 			       & ~ira_no_alloc_regs
 			       & reg_class_contents[ALLOCNO_CLASS (a)]);
-      print_hard_reg_set (file, ";;     conflict hard regs:",
-			  conflicting_hard_regs);
+      print_hard_reg_set (file, conflicting_hard_regs,
+			  ";;     conflict hard regs:", true);
       putc ('\n', file);
     }
 
diff --git a/gcc/sel-sched-dump.cc b/gcc/sel-sched-dump.cc
index 05de9840937..5b2439cf4e2 100644
--- a/gcc/sel-sched-dump.cc
+++ b/gcc/sel-sched-dump.cc
@@ -535,26 +535,13 @@ dump_insn_vector (rtx_vec_t succs)
       sel_print ("NULL ");
 }
 
-/* Dumps a hard reg set SET to FILE using PREFIX.  */
-static void
-print_hard_reg_set (FILE *file, const char *prefix, HARD_REG_SET set)
-{
-  int i;
-
-  fprintf (file, "%s{ ", prefix);
-  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-    {
-      if (TEST_HARD_REG_BIT (set, i))
-	fprintf (file, "%d ", i);
-    }
-  fprintf (file, "}\n");
-}
-
 /* Dumps a hard reg set SET using PREFIX.  */
-void
+DEBUG_FUNCTION void
 dump_hard_reg_set (const char *prefix, HARD_REG_SET set)
 {
-  print_hard_reg_set (sched_dump, prefix, set);
+  fprintf (sched_dump, "%s{", prefix);
+  print_hard_reg_set (sched_dump, set, NULL, false);
+  fprintf (sched_dump, "}\n");
 }
 
 /* Pretty print INSN.  This is used as a hook.  */
diff --git a/gcc/sel-sched-dump.h b/gcc/sel-sched-dump.h
index 2a207cefda2..e5095b2e986 100644
--- a/gcc/sel-sched-dump.h
+++ b/gcc/sel-sched-dump.h
@@ -214,7 +214,7 @@ extern void dump_av_set (av_set_t);
 extern void dump_lv_set (regset);
 extern void dump_blist (blist_t);
 extern void dump_flist (flist_t);
-extern void dump_hard_reg_set (const char *, HARD_REG_SET);
+DEBUG_FUNCTION extern void dump_hard_reg_set (const char *, HARD_REG_SET);
 extern void sel_debug_cfg_1 (int);
 extern void sel_debug_cfg (void);
 extern void setup_dump_cfg_params (void);
