From fdcd3bc0c76140d8d2e28cd4b8d15cc55ddba4b0 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 1 Feb 2017 15:34:52 +0100
Subject: [PATCH 2/3] Introduce dump_flags_t type and use it instead of int
 type.

gcc/cp/ChangeLog:

2017-05-12  Martin Liska  <mliska@suse.cz>

	* class.c (dump_class_hierarchy): Introduce dump_flags_t type and
	use it instead of int type.
	(dump_vtable): Likewise.
	(dump_vtt): Likewise.
	* decl2.c (dump_tu): Likewise.

gcc/c-family/ChangeLog:

2017-05-12  Martin Liska  <mliska@suse.cz>

	* c-common.h: Introduce dump_flags_t type and
	use it instead of int type.
	* c-gimplify.c (c_genericize): Likewise.
	* c-opts.c: Likewise.

gcc/c/ChangeLog:

2017-05-12  Martin Liska  <mliska@suse.cz>

	* c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and
	use it instead of int type.

gcc/ChangeLog:

2017-05-12  Martin Liska  <mliska@suse.cz>

	* cfg.c: Introduce dump_flags_t type and
	use it instead of int type.
	* cfg.h: Likewise.
	* cfghooks.c: Likewise.
	* cfghooks.h (struct cfg_hooks): Likewise.
	* cfgrtl.c: Likewise.
	* cfgrtl.h: Likewise.
	* cgraph.c (cgraph_node::get_body): Likewise.
	* coretypes.h: Likewise.
	* domwalk.c: Likewise.
	* domwalk.h: Likewise.
	* dumpfile.c (struct dump_option_value_info): Likewise.
	(dump_enable_all): Likewise.
	(dump_switch_p_1): Likewise.
	(opt_info_switch_p): Likewise.
	* dumpfile.h (enum tree_dump_index): Likewise.
	(struct dump_file_info): Likewise.
	* genemit.c: Likewise.
	* generic-match-head.c: Likewise.
	* gengtype.c (open_base_files): Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-pretty-print.h: Likewise.
	* graph.c (print_graph_cfg): Likewise.
	* graphite-scop-detection.c (dot_all_sese): Likewise.
	* ipa-devirt.c (build_type_inheritance_graph): Likewise.
	* loop-unroll.c (report_unroll): Likewise.
	* passes.c (pass_manager::register_one_dump_file): Likewise.
	* print-tree.c: Likewise.
	* statistics.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfg.h: Likewise.
	* tree-dfa.c: Likewise.
	* tree-dfa.h: Likewise.
	* tree-dump.c (dump_function): Likewise.
	* tree-dump.h (struct dump_info): Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-pretty-print.h: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-slp.c: Likewise.
---
 gcc/c-family/c-common.h       |   2 +-
 gcc/c-family/c-gimplify.c     |   2 +-
 gcc/c-family/c-opts.c         |   6 +-
 gcc/c/c-decl.c                |   2 +-
 gcc/cfg.c                     |   8 +--
 gcc/cfg.h                     |   6 +-
 gcc/cfghooks.c                |   4 +-
 gcc/cfghooks.h                |   6 +-
 gcc/cfgrtl.c                  |   8 +--
 gcc/cfgrtl.h                  |   4 +-
 gcc/cgraph.c                  |   2 +-
 gcc/coretypes.h               |   1 +
 gcc/cp/class.c                |  14 ++---
 gcc/cp/decl2.c                |   2 +-
 gcc/domwalk.c                 |   2 +-
 gcc/domwalk.h                 |   2 +-
 gcc/dumpfile.c                |  52 +++++++++--------
 gcc/dumpfile.h                |  43 ++++++++------
 gcc/genemit.c                 |   1 -
 gcc/generic-match-head.c      |   1 -
 gcc/gengtype.c                |   3 +-
 gcc/gimple-pretty-print.c     | 127 +++++++++++++++++++++++++-----------------
 gcc/gimple-pretty-print.h     |  10 ++--
 gcc/graph.c                   |   4 +-
 gcc/graphite-scop-detection.c |   4 +-
 gcc/ipa-devirt.c              |   2 +-
 gcc/loop-unroll.c             |   2 +-
 gcc/passes.c                  |   3 +-
 gcc/print-tree.c              |   2 +-
 gcc/statistics.c              |   2 +-
 gcc/tree-cfg.c                |  10 ++--
 gcc/tree-cfg.h                |   4 +-
 gcc/tree-dfa.c                |   2 +-
 gcc/tree-dfa.h                |   2 +-
 gcc/tree-dump.c               |   4 +-
 gcc/tree-dump.h               |   4 +-
 gcc/tree-pretty-print.c       |  39 ++++++-------
 gcc/tree-pretty-print.h       |  18 +++---
 gcc/tree-ssa-live.c           |   8 +--
 gcc/tree-ssa-live.h           |   6 +-
 gcc/tree-ssa-loop-ivcanon.c   |   2 +-
 gcc/tree-vect-loop.c          |   2 +-
 gcc/tree-vect-slp.c           |   2 +-
 43 files changed, 236 insertions(+), 194 deletions(-)

diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 9e3982d1ce8..ded0c37bc8a 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -904,7 +904,7 @@ extern bool c_common_post_options (const char **);
 extern bool c_common_init (void);
 extern void c_common_finish (void);
 extern void c_common_parse_file (void);
-extern FILE *get_dump_info (int, int *);
+extern FILE *get_dump_info (int, dump_flags_t *);
 extern alias_set_type c_common_get_alias_set (tree);
 extern void c_register_builtin_type (tree, const char*);
 extern bool c_promoting_integer_type_p (const_tree);
diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c
index 1ae75d294ff..6a4b7c77a34 100644
--- a/gcc/c-family/c-gimplify.c
+++ b/gcc/c-family/c-gimplify.c
@@ -115,7 +115,7 @@ void
 c_genericize (tree fndecl)
 {
   FILE *dump_orig;
-  int local_dump_flags;
+  dump_flags_t local_dump_flags;
   struct cgraph_node *cgn;
 
   if (flag_sanitize & SANITIZE_BOUNDS)
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index ed1b0377fa0..d294c37bdba 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -101,9 +101,9 @@ static size_t include_cursor;
 
 /* Dump files/flags to use during parsing.  */
 static FILE *original_dump_file = NULL;
-static int original_dump_flags;
+static dump_flags_t original_dump_flags;
 static FILE *class_dump_file = NULL;
-static int class_dump_flags;
+static dump_flags_t class_dump_flags;
 
 /* Whether any standard preincluded header has been preincluded.  */
 static bool done_preinclude;
@@ -1136,7 +1136,7 @@ c_common_parse_file (void)
 
 /* Returns the appropriate dump file for PHASE to dump with FLAGS.  */
 FILE *
-get_dump_info (int phase, int *flags)
+get_dump_info (int phase, dump_flags_t *flags)
 {
   gcc_assert (phase == TDI_original || phase == TDI_class);
   if (phase == TDI_original)
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index b779d37aaae..39acb3936f2 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -11243,7 +11243,7 @@ c_parse_final_cleanups (void)
   if (ext_block)
     {
       tree tmp = BLOCK_VARS (ext_block);
-      int flags;
+      dump_flags_t flags;
       FILE * stream = dump_begin (TDI_tu, &flags);
       if (stream && tmp)
 	{
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 7a0e5bb16cb..ffac69f266d 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -396,7 +396,7 @@ clear_bb_flags (void)
    It is still practical to have them reported for debugging of simple
    testcases.  */
 static void
-check_bb_profile (basic_block bb, FILE * file, int indent, int flags)
+check_bb_profile (basic_block bb, FILE * file, int indent, dump_flags_t flags)
 {
   edge e;
   int sum = 0;
@@ -474,7 +474,7 @@ check_bb_profile (basic_block bb, FILE * file, int indent, int flags)
 }
 
 void
-dump_edge_info (FILE *file, edge e, int flags, int do_succ)
+dump_edge_info (FILE *file, edge e, dump_flags_t flags, int do_succ)
 {
   basic_block side = (do_succ ? e->dest : e->src);
   bool do_details = false;
@@ -713,7 +713,7 @@ debug_bb_n (int n)
    that maybe_hot_bb_p and probably_never_executed_bb_p don't ICE.  */
 
 void
-dump_bb_info (FILE *outf, basic_block bb, int indent, int flags,
+dump_bb_info (FILE *outf, basic_block bb, int indent, dump_flags_t flags,
 	      bool do_header, bool do_footer)
 {
   edge_iterator ei;
@@ -833,7 +833,7 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, int flags,
 /* Dumps a brief description of cfg to FILE.  */
 
 void
-brief_dump_cfg (FILE *file, int flags)
+brief_dump_cfg (FILE *file, dump_flags_t flags)
 {
   basic_block bb;
 
diff --git a/gcc/cfg.h b/gcc/cfg.h
index b44f1e11e35..f71c00e6df8 100644
--- a/gcc/cfg.h
+++ b/gcc/cfg.h
@@ -89,7 +89,7 @@ extern void remove_edge_raw (edge);
 extern void redirect_edge_succ (edge, basic_block);
 extern void redirect_edge_pred (edge, basic_block);
 extern void clear_bb_flags (void);
-extern void dump_edge_info (FILE *, edge, int, int);
+extern void dump_edge_info (FILE *, edge, dump_flags_t, int);
 extern void debug (edge_def &ref);
 extern void debug (edge_def *ptr);
 extern void alloc_aux_for_blocks (int);
@@ -101,8 +101,8 @@ extern void clear_aux_for_edges (void);
 extern void free_aux_for_edges (void);
 extern void debug_bb (basic_block);
 extern basic_block debug_bb_n (int);
-extern void dump_bb_info (FILE *, basic_block, int, int, bool, bool);
-extern void brief_dump_cfg (FILE *, int);
+extern void dump_bb_info (FILE *, basic_block, int, dump_flags_t, bool, bool);
+extern void brief_dump_cfg (FILE *, dump_flags_t);
 extern void update_bb_profile_for_threading (basic_block, int, gcov_type, edge);
 extern void scale_bbs_frequencies_int (basic_block *, int, int, int);
 extern void scale_bbs_frequencies_gcov_type (basic_block *, int, gcov_type,
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index ce2da6a2f39..1644c9ff31c 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -269,7 +269,7 @@ verify_flow_info (void)
    representation-specific information.  */
 
 void
-dump_bb (FILE *outf, basic_block bb, int indent, int flags)
+dump_bb (FILE *outf, basic_block bb, int indent, dump_flags_t flags)
 {
   if (flags & TDF_BLOCKS)
     dump_bb_info (outf, bb, indent, flags, true, false);
@@ -319,7 +319,7 @@ dump_bb_for_graph (pretty_printer *pp, basic_block bb)
 
 /* Dump the complete CFG to FILE.  FLAGS are the TDF_* flags in dumpfile.h.  */
 void
-dump_flow_info (FILE *file, int flags)
+dump_flow_info (FILE *file, dump_flags_t flags)
 {
   basic_block bb;
 
diff --git a/gcc/cfghooks.h b/gcc/cfghooks.h
index 4c1abe73623..5800a331e41 100644
--- a/gcc/cfghooks.h
+++ b/gcc/cfghooks.h
@@ -62,7 +62,7 @@ struct cfg_hooks
 
   /* Debugging.  */
   int (*verify_flow_info) (void);
-  void (*dump_bb) (FILE *, basic_block, int, int);
+  void (*dump_bb) (FILE *, basic_block, int, dump_flags_t);
   void (*dump_bb_for_graph) (pretty_printer *, basic_block);
 
   /* Basic CFG manipulation.  */
@@ -198,9 +198,9 @@ checking_verify_flow_info (void)
     verify_flow_info ();
 }
 
-extern void dump_bb (FILE *, basic_block, int, int);
+extern void dump_bb (FILE *, basic_block, int, dump_flags_t);
 extern void dump_bb_for_graph (pretty_printer *, basic_block);
-extern void dump_flow_info (FILE *, int);
+extern void dump_flow_info (FILE *, dump_flags_t);
 
 extern edge redirect_edge_and_branch (edge, basic_block);
 extern basic_block redirect_edge_and_branch_force (edge, basic_block);
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index cafa38d35b0..ead82d23166 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -86,7 +86,7 @@ static void rtl_delete_block (basic_block);
 static basic_block rtl_redirect_edge_and_branch_force (edge, basic_block);
 static edge rtl_redirect_edge_and_branch (edge, basic_block);
 static basic_block rtl_split_block (basic_block, void *);
-static void rtl_dump_bb (FILE *, basic_block, int, int);
+static void rtl_dump_bb (FILE *, basic_block, int, dump_flags_t);
 static int rtl_verify_flow_info_1 (void);
 static void rtl_make_forwarder_block (edge);
 
@@ -2112,7 +2112,7 @@ commit_edge_insertions (void)
    documented in dumpfile.h.  */
 
 static void
-rtl_dump_bb (FILE *outf, basic_block bb, int indent, int flags)
+rtl_dump_bb (FILE *outf, basic_block bb, int indent, dump_flags_t flags)
 {
   rtx_insn *insn;
   rtx_insn *last;
@@ -2155,7 +2155,7 @@ rtl_dump_bb (FILE *outf, basic_block bb, int indent, int flags)
    in dumpfile.h.  */
 
 void
-print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, int flags)
+print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags)
 {
   const rtx_insn *tmp_rtx;
   if (rtx_first == 0)
@@ -4242,7 +4242,7 @@ cfg_layout_duplicate_bb (basic_block bb)
    FLAGS is a set of additional flags to pass to cleanup_cfg().  */
 
 void
-cfg_layout_initialize (unsigned int flags)
+cfg_layout_initialize (int flags)
 {
   rtx_insn_list *x;
   basic_block bb;
diff --git a/gcc/cfgrtl.h b/gcc/cfgrtl.h
index befd1aaaa85..9235b50ed66 100644
--- a/gcc/cfgrtl.h
+++ b/gcc/cfgrtl.h
@@ -40,7 +40,7 @@ extern basic_block force_nonfallthru_and_redirect (edge, basic_block, rtx);
 extern void insert_insn_on_edge (rtx, edge);
 extern void commit_one_edge_insertion (edge e);
 extern void commit_edge_insertions (void);
-extern void print_rtl_with_bb (FILE *, const rtx_insn *, int);
+extern void print_rtl_with_bb (FILE *, const rtx_insn *, dump_flags_t);
 extern void update_br_prob_note (basic_block);
 extern rtx_insn *get_last_bb_insn (basic_block);
 extern void fixup_partitions (void);
@@ -50,7 +50,7 @@ extern bool fixup_abnormal_edges (void);
 extern rtx_insn *unlink_insn_chain (rtx_insn *, rtx_insn *);
 extern void relink_block_chain (bool);
 extern rtx_insn *duplicate_insn_chain (rtx_insn *, rtx_insn *);
-extern void cfg_layout_initialize (unsigned int);
+extern void cfg_layout_initialize (int);
 extern void cfg_layout_finalize (void);
 extern void break_superblocks (void);
 extern void init_rtl_bb_info (basic_block);
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index d5294c8ce92..10ba987701c 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -3652,7 +3652,7 @@ cgraph_node::get_body (void)
       opt_pass *saved_current_pass = current_pass;
       FILE *saved_dump_file = dump_file;
       const char *saved_dump_file_name = dump_file_name;
-      int saved_dump_flags = dump_flags;
+      dump_flags_t saved_dump_flags = dump_flags;
       dump_file_name = NULL;
       dump_file = NULL;
 
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 8eb33ccf123..b7c3704eff8 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -371,6 +371,7 @@ typedef unsigned char uchar;
 #include "input.h"
 #include "is-a.h"
 #include "memory-block.h"
+#include "dumpfile.h"
 #endif /* GENERATOR_FILE && !USED_FOR_TARGET */
 
 #endif /* coretypes.h */
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 15b583aa96d..7b5daeaf9d1 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -172,9 +172,9 @@ static tree find_final_overrider (tree, tree, tree);
 static int make_new_vtable (tree, tree);
 static tree get_primary_binfo (tree);
 static int maybe_indent_hierarchy (FILE *, int, int);
-static tree dump_class_hierarchy_r (FILE *, int, tree, tree, int);
+static tree dump_class_hierarchy_r (FILE *, dump_flags_t, tree, tree, int);
 static void dump_class_hierarchy (tree);
-static void dump_class_hierarchy_1 (FILE *, int, tree);
+static void dump_class_hierarchy_1 (FILE *, dump_flags_t, tree);
 static void dump_array (FILE *, tree);
 static void dump_vtable (tree, tree, tree);
 static void dump_vtt (tree, tree);
@@ -8844,7 +8844,7 @@ maybe_indent_hierarchy (FILE * stream, int indent, int indented_p)
 
 static tree
 dump_class_hierarchy_r (FILE *stream,
-			int flags,
+			dump_flags_t flags,
 			tree binfo,
 			tree igo,
 			int indent)
@@ -8937,7 +8937,7 @@ dump_class_hierarchy_r (FILE *stream,
 /* Dump the BINFO hierarchy for T.  */
 
 static void
-dump_class_hierarchy_1 (FILE *stream, int flags, tree t)
+dump_class_hierarchy_1 (FILE *stream, dump_flags_t flags, tree t)
 {
   fprintf (stream, "Class %s\n", type_as_string (t, TFF_PLAIN_IDENTIFIER));
   fprintf (stream, "   size=%lu align=%lu\n",
@@ -8963,7 +8963,7 @@ debug_class (tree t)
 static void
 dump_class_hierarchy (tree t)
 {
-  int flags;
+  dump_flags_t flags;
   FILE *stream = get_dump_info (TDI_class, &flags);
 
   if (stream)
@@ -8997,7 +8997,7 @@ dump_array (FILE * stream, tree decl)
 static void
 dump_vtable (tree t, tree binfo, tree vtable)
 {
-  int flags;
+  dump_flags_t flags;
   FILE *stream = get_dump_info (TDI_class, &flags);
 
   if (!stream)
@@ -9026,7 +9026,7 @@ dump_vtable (tree t, tree binfo, tree vtable)
 static void
 dump_vtt (tree t, tree vtt)
 {
-  int flags;
+  dump_flags_t flags;
   FILE *stream = get_dump_info (TDI_class, &flags);
 
   if (!stream)
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 46959ec77f7..9f28d1a7df3 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -4369,7 +4369,7 @@ generate_mangling_aliases ()
 static void
 dump_tu (void)
 {
-  int flags;
+  dump_flags_t flags;
   FILE *stream = dump_begin (TDI_tu, &flags);
 
   if (stream)
diff --git a/gcc/domwalk.c b/gcc/domwalk.c
index c7d9654b452..a0daae6b2d8 100644
--- a/gcc/domwalk.c
+++ b/gcc/domwalk.c
@@ -201,7 +201,7 @@ dom_walker::bb_reachable (struct function *fun, basic_block bb)
 void
 dom_walker::propagate_unreachable_to_edges (basic_block bb,
 					    FILE *dump_file,
-					    int dump_flags)
+					    dump_flags_t dump_flags)
 {
   if (dump_file && (dump_flags & TDF_DETAILS))
     fprintf (dump_file, "Marking all outgoing edges of unreachable "
diff --git a/gcc/domwalk.h b/gcc/domwalk.h
index bbb9afc0fbe..4b9f70ac703 100644
--- a/gcc/domwalk.h
+++ b/gcc/domwalk.h
@@ -70,7 +70,7 @@ private:
      and possibly incoming edges for the block.  Typically called after
      determining a block is unreachable in the before_dom_children
      callback.  */
-  void propagate_unreachable_to_edges (basic_block, FILE *, int);
+  void propagate_unreachable_to_edges (basic_block, FILE *, dump_flags_t);
 
 };
 
diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c
index d9a84ff661f..ee967d825f4 100644
--- a/gcc/dumpfile.c
+++ b/gcc/dumpfile.c
@@ -33,10 +33,10 @@ along with GCC; see the file COPYING3.  If not see
 #define skip_leading_substring(whole,  part) \
    (strncmp (whole, part, strlen (part)) ? NULL : whole + strlen (part))
 
-static int pflags;                   /* current dump_flags */
-static int alt_flags;                /* current opt_info flags */
+static dump_flags_t pflags;		      /* current dump_flags */
+static dump_flags_t alt_flags;		      /* current opt_info flags */
 
-static void dump_loc (int, FILE *, source_location);
+static void dump_loc (dump_flags_t, FILE *, source_location);
 static FILE *dump_open_alternate_stream (struct dump_file_info *);
 
 /* These are currently used for communicating between passes.
@@ -45,7 +45,7 @@ static FILE *dump_open_alternate_stream (struct dump_file_info *);
 FILE *dump_file = NULL;
 FILE *alt_dump_file = NULL;
 const char *dump_file_name;
-int dump_flags;
+dump_flags_t dump_flags;
 
 /* Table of tree dump switches. This must be consistent with the
    TREE_DUMP_INDEX enumeration in dumpfile.h.  */
@@ -84,7 +84,7 @@ static struct dump_file_info dump_files[TDI_end] =
 struct dump_option_value_info
 {
   const char *const name;	/* the name of the value */
-  const int value;		/* the value of the name */
+  const dump_flags_t value;	/* the value of the name */
 };
 
 /* Table of dump options. This must be consistent with the TDF_* flags
@@ -181,7 +181,7 @@ gcc::dump_manager::~dump_manager ()
 unsigned int
 gcc::dump_manager::
 dump_register (const char *suffix, const char *swtch, const char *glob,
-	       int flags, int optgroup_flags,
+	       dump_flags_t flags, int optgroup_flags,
 	       bool take_ownership)
 {
   int num = m_next_dump++;
@@ -327,7 +327,7 @@ dump_open_alternate_stream (struct dump_file_info *dfi)
 /* Print source location on DFILE if enabled.  */
 
 void
-dump_loc (int dump_kind, FILE *dfile, source_location loc)
+dump_loc (dump_flags_t dump_kind, FILE *dfile, source_location loc)
 {
   if (dump_kind)
     {
@@ -346,7 +346,8 @@ dump_loc (int dump_kind, FILE *dfile, source_location loc)
    EXTRA_DUMP_FLAGS on the dump streams if DUMP_KIND is enabled.  */
 
 void
-dump_gimple_stmt (int dump_kind, int extra_dump_flags, gimple *gs, int spc)
+dump_gimple_stmt (dump_flags_t dump_kind, dump_flags_t extra_dump_flags,
+		  gimple *gs, int spc)
 {
   if (dump_file && (dump_kind & pflags))
     print_gimple_stmt (dump_file, gs, spc, dump_flags | extra_dump_flags);
@@ -358,8 +359,8 @@ dump_gimple_stmt (int dump_kind, int extra_dump_flags, gimple *gs, int spc)
 /* Similar to dump_gimple_stmt, except additionally print source location.  */
 
 void
-dump_gimple_stmt_loc (int dump_kind, source_location loc, int extra_dump_flags,
-		      gimple *gs, int spc)
+dump_gimple_stmt_loc (dump_flags_t dump_kind, source_location loc,
+		      dump_flags_t extra_dump_flags, gimple *gs, int spc)
 {
   if (dump_file && (dump_kind & pflags))
     {
@@ -378,7 +379,8 @@ dump_gimple_stmt_loc (int dump_kind, source_location loc, int extra_dump_flags,
    DUMP_KIND is enabled.  */
 
 void
-dump_generic_expr (int dump_kind, int extra_dump_flags, tree t)
+dump_generic_expr (dump_flags_t dump_kind, dump_flags_t extra_dump_flags,
+		   tree t)
 {
   if (dump_file && (dump_kind & pflags))
       print_generic_expr (dump_file, t, dump_flags | extra_dump_flags);
@@ -393,7 +395,7 @@ dump_generic_expr (int dump_kind, int extra_dump_flags, tree t)
 
 void
 dump_generic_expr_loc (int dump_kind, source_location loc,
-                       int extra_dump_flags, tree t)
+		       dump_flags_t extra_dump_flags, tree t)
 {
   if (dump_file && (dump_kind & pflags))
     {
@@ -411,7 +413,7 @@ dump_generic_expr_loc (int dump_kind, source_location loc,
 /* Output a formatted message using FORMAT on appropriate dump streams.  */
 
 void
-dump_printf (int dump_kind, const char *format, ...)
+dump_printf (dump_flags_t dump_kind, const char *format, ...)
 {
   if (dump_file && (dump_kind & pflags))
     {
@@ -433,7 +435,8 @@ dump_printf (int dump_kind, const char *format, ...)
 /* Similar to dump_printf, except source location is also printed.  */
 
 void
-dump_printf_loc (int dump_kind, source_location loc, const char *format, ...)
+dump_printf_loc (dump_flags_t dump_kind, source_location loc,
+		 const char *format, ...)
 {
   if (dump_file && (dump_kind & pflags))
     {
@@ -462,7 +465,7 @@ dump_printf_loc (int dump_kind, source_location loc, const char *format, ...)
 
 int
 gcc::dump_manager::
-dump_start (int phase, int *flag_ptr)
+dump_start (int phase, dump_flags_t *flag_ptr)
 {
   int count = 0;
   char *name;
@@ -546,14 +549,14 @@ dump_finish (int phase)
    Multiple calls will reopen and append to the dump file.  */
 
 FILE *
-dump_begin (int phase, int *flag_ptr)
+dump_begin (int phase, dump_flags_t *flag_ptr)
 {
   return g->get_dumps ()->dump_begin (phase, flag_ptr);
 }
 
 FILE *
 gcc::dump_manager::
-dump_begin (int phase, int *flag_ptr)
+dump_begin (int phase, dump_flags_t *flag_ptr)
 {
   char *name;
   struct dump_file_info *dfi;
@@ -654,9 +657,9 @@ dump_end (int phase ATTRIBUTE_UNUSED, FILE *stream)
 
 int
 gcc::dump_manager::
-dump_enable_all (int flags, const char *filename)
+dump_enable_all (dump_flags_t flags, const char *filename)
 {
-  int ir_dump_type = TDF_KIND (flags);
+  dump_flags_t ir_dump_type = TDF_KIND (flags);
   int n = 0;
   size_t i;
 
@@ -711,7 +714,8 @@ dump_enable_all (int flags, const char *filename)
 
 int
 gcc::dump_manager::
-opt_info_enable_passes (int optgroup_flags, int flags, const char *filename)
+opt_info_enable_passes (int optgroup_flags, dump_flags_t flags,
+			const char *filename)
 {
   int n = 0;
   size_t i;
@@ -764,7 +768,7 @@ dump_switch_p_1 (const char *arg, struct dump_file_info *dfi, bool doglob)
 {
   const char *option_value;
   const char *ptr;
-  int flags;
+  dump_flags_t flags;
 
   if (doglob && !dfi->glob)
     return 0;
@@ -863,7 +867,7 @@ dump_switch_p (const char *arg)
    and filename.  Return non-zero if it is a recognized switch.  */
 
 static int
-opt_info_switch_p_1 (const char *arg, int *flags, int *optgroup_flags,
+opt_info_switch_p_1 (const char *arg, dump_flags_t *flags, int *optgroup_flags,
                      char **filename)
 {
   const char *option_value;
@@ -941,7 +945,7 @@ opt_info_switch_p_1 (const char *arg, int *flags, int *optgroup_flags,
 int
 opt_info_switch_p (const char *arg)
 {
-  int flags;
+  dump_flags_t flags;
   int optgroup_flags;
   char *filename;
   static char *file_seen = NULL;
@@ -987,7 +991,7 @@ void
 dump_function (int phase, tree fn)
 {
   FILE *stream;
-  int flags;
+  dump_flags_t flags;
 
   stream = dump_begin (phase, &flags);
   if (stream)
diff --git a/gcc/dumpfile.h b/gcc/dumpfile.h
index 19c6d3ec90e..3eec6ab56d5 100644
--- a/gcc/dumpfile.h
+++ b/gcc/dumpfile.h
@@ -98,6 +98,7 @@ enum tree_dump_index
 #define MSG_ALL		(MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION \
 			 | MSG_NOTE)
 
+#define TDF_NONE 0
 
 /* Flags to control high-level -fopt-info dumps.  Usually these flags
    define a group of passes.  An optimization pass can be part of
@@ -113,6 +114,14 @@ enum tree_dump_index
 #define OPTGROUP_ALL	     (OPTGROUP_IPA | OPTGROUP_LOOP | OPTGROUP_INLINE \
 			      | OPTGROUP_OMP | OPTGROUP_VEC | OPTGROUP_OTHER)
 
+/* Dump flags type.  */
+
+typedef uint64_t dump_flags_t;
+
+/* Dump flags type.  */
+
+typedef uint64_t dump_flags_t;
+
 /* Define a tree dump switch.  */
 struct dump_file_info
 {
@@ -123,7 +132,7 @@ struct dump_file_info
   const char *alt_filename;	/* filename for the -fopt-info stream  */
   FILE *pstream;		/* pass-specific dump stream  */
   FILE *alt_stream;		/* -fopt-info stream */
-  int pflags;			/* dump flags */
+  dump_flags_t pflags;		/* dump flags */
   int optgroup_flags;		/* optgroup flags for -fopt-info */
   int alt_flags;		/* flags for opt-info */
   int pstate;			/* state of pass-specific stream */
@@ -140,34 +149,35 @@ struct dump_file_info
 };
 
 /* In dumpfile.c */
-extern FILE *dump_begin (int, int *);
+extern FILE *dump_begin (int, dump_flags_t *);
 extern void dump_end (int, FILE *);
 extern int opt_info_switch_p (const char *);
 extern const char *dump_flag_name (int);
-extern void dump_printf (int, const char *, ...) ATTRIBUTE_PRINTF_2;
-extern void dump_printf_loc (int, source_location,
-			     const char *, ...) ATTRIBUTE_PRINTF_3;
+extern void dump_printf (dump_flags_t, const char *, ...) ATTRIBUTE_PRINTF_2;
+extern void dump_printf_loc (dump_flags_t, source_location,
+                             const char *, ...) ATTRIBUTE_PRINTF_3;
 extern void dump_function (int phase, tree fn);
 extern void dump_basic_block (int, basic_block, int);
 extern void dump_generic_expr_loc (int, source_location, int, tree);
-extern void dump_generic_expr (int, int, tree);
-extern void dump_gimple_stmt_loc (int, source_location, int, gimple *, int);
-extern void dump_gimple_stmt (int, int, gimple *, int);
+extern void dump_generic_expr (dump_flags_t, dump_flags_t, tree);
+extern void dump_gimple_stmt_loc (dump_flags_t, source_location, dump_flags_t,
+				  gimple *, int);
+extern void dump_gimple_stmt (dump_flags_t, dump_flags_t, gimple *, int);
 extern void print_combine_total_stats (void);
 extern bool enable_rtl_dump_file (void);
 
 /* In tree-dump.c  */
-extern void dump_node (const_tree, int, FILE *);
+extern void dump_node (const_tree, dump_flags_t, FILE *);
 
 /* In combine.c  */
 extern void dump_combine_total_stats (FILE *);
 /* In cfghooks.c  */
-extern void dump_bb (FILE *, basic_block, int, int);
+extern void dump_bb (FILE *, basic_block, int, dump_flags_t);
 
 /* Global variables used to communicate with passes.  */
 extern FILE *dump_file;
 extern FILE *alt_dump_file;
-extern int dump_flags;
+extern dump_flags_t dump_flags;
 extern const char *dump_file_name;
 
 /* Return true if any of the dumps is enabled, false otherwise. */
@@ -192,7 +202,7 @@ public:
      SUFFIX, SWTCH, and GLOB. */
   unsigned int
   dump_register (const char *suffix, const char *swtch, const char *glob,
-		 int flags, int optgroup_flags,
+		 dump_flags_t flags, int optgroup_flags,
 		 bool take_ownership);
 
   /* Return the dump_file_info for the given phase.  */
@@ -219,7 +229,7 @@ public:
      set dump_flags appropriately for both pass dump stream and
      -fopt-info stream. */
   int
-  dump_start (int phase, int *flag_ptr);
+  dump_start (int phase, dump_flags_t *flag_ptr);
 
   /* Finish a tree dump for PHASE and close associated dump streams.  Also
      reset the globals DUMP_FILE, ALT_DUMP_FILE, and DUMP_FLAGS.  */
@@ -227,7 +237,7 @@ public:
   dump_finish (int phase);
 
   FILE *
-  dump_begin (int phase, int *flag_ptr);
+  dump_begin (int phase, dump_flags_t *flag_ptr);
 
   /* Returns nonzero if tree dump PHASE has been initialized.  */
   int
@@ -246,10 +256,11 @@ private:
   dump_switch_p_1 (const char *arg, struct dump_file_info *dfi, bool doglob);
 
   int
-  dump_enable_all (int flags, const char *filename);
+  dump_enable_all (dump_flags_t flags, const char *filename);
 
   int
-  opt_info_enable_passes (int optgroup_flags, int flags, const char *filename);
+  opt_info_enable_passes (int optgroup_flags, dump_flags_t flags,
+			  const char *filename);
 
 private:
 
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 7bf745d1727..6e60c0a76ca 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -797,7 +797,6 @@ from the machine description file `md'.  */\n\n");
   printf ("#include \"regs.h\"\n");
   printf ("#include \"tm-constrs.h\"\n");
   printf ("#include \"ggc.h\"\n");
-  printf ("#include \"dumpfile.h\"\n");
   printf ("#include \"target.h\"\n\n");
 
   /* Read the machine description.  */
diff --git a/gcc/generic-match-head.c b/gcc/generic-match-head.c
index 04e0854fd75..0c0d1824933 100644
--- a/gcc/generic-match-head.c
+++ b/gcc/generic-match-head.c
@@ -31,7 +31,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "stor-layout.h"
 #include "tree-dfa.h"
 #include "builtins.h"
-#include "dumpfile.h"
 #include "case-cfn-macros.h"
 #include "gimplify.h"
 
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index a315c6cfe87..b02e9fffb23 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1706,7 +1706,8 @@ open_base_files (void)
   {
     /* The order of files here matters very much.  */
     static const char *const ifiles[] = {
-      "config.h", "system.h", "coretypes.h", "backend.h", "predict.h", "tree.h",
+      "config.h", "system.h", "coretypes.h",
+      "backend.h", "predict.h", "tree.h",
       "rtl.h", "gimple.h", "fold-const.h", "insn-codes.h", "splay-tree.h",
       "alias.h", "insn-config.h", "flags.h", "expmed.h", "dojump.h",
       "explow.h", "calls.h", "cilk.h", "memmodel.h", "emit-rtl.h", "varasm.h",
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index a7a5d00dc2e..c99dfe1192c 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
+#include "dumpfile.h"
 #include "backend.h"
 #include "tree.h"
 #include "gimple.h"
@@ -108,7 +109,7 @@ dump_edge_probability (pretty_printer *buffer, edge e)
    FLAGS as in pp_gimple_stmt_1.  */
 
 void
-print_gimple_stmt (FILE *file, gimple *g, int spc, int flags)
+print_gimple_stmt (FILE *file, gimple *g, int spc, dump_flags_t flags)
 {
   pretty_printer buffer;
   pp_needs_newline (&buffer) = true;
@@ -138,7 +139,7 @@ debug (gimple *ptr)
    of the statement.  */
 
 void
-print_gimple_expr (FILE *file, gimple *g, int spc, int flags)
+print_gimple_expr (FILE *file, gimple *g, int spc, dump_flags_t flags)
 {
   flags |= TDF_RHS_ONLY;
   pretty_printer buffer;
@@ -155,7 +156,8 @@ print_gimple_expr (FILE *file, gimple *g, int spc, int flags)
    the pretty printer.  */
 
 static void
-dump_gimple_seq (pretty_printer *buffer, gimple_seq seq, int spc, int flags)
+dump_gimple_seq (pretty_printer *buffer, gimple_seq seq, int spc,
+		 dump_flags_t flags)
 {
   gimple_stmt_iterator i;
 
@@ -174,7 +176,7 @@ dump_gimple_seq (pretty_printer *buffer, gimple_seq seq, int spc, int flags)
    FLAGS as in pp_gimple_stmt_1.  */
 
 void
-print_gimple_seq (FILE *file, gimple_seq seq, int spc, int flags)
+print_gimple_seq (FILE *file, gimple_seq seq, int spc, dump_flags_t flags)
 {
   pretty_printer buffer;
   pp_needs_newline (&buffer) = true;
@@ -206,7 +208,7 @@ debug_gimple_seq (gimple_seq seq)
      '-' - decreases indent by 2 then outputs a newline.   */
 
 static void
-dump_gimple_fmt (pretty_printer *buffer, int spc, int flags,
+dump_gimple_fmt (pretty_printer *buffer, int spc, dump_flags_t flags,
                  const char *fmt, ...)
 {
   va_list args;
@@ -285,7 +287,8 @@ dump_gimple_fmt (pretty_printer *buffer, int spc, int flags,
    assignment GS.  BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.  */
 
 static void
-dump_unary_rhs (pretty_printer *buffer, gassign *gs, int spc, int flags)
+dump_unary_rhs (pretty_printer *buffer, gassign *gs, int spc,
+		dump_flags_t flags)
 {
   enum tree_code rhs_code = gimple_assign_rhs_code (gs);
   tree lhs = gimple_assign_lhs (gs);
@@ -377,7 +380,8 @@ dump_unary_rhs (pretty_printer *buffer, gassign *gs, int spc, int flags)
    assignment GS.  BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.  */
 
 static void
-dump_binary_rhs (pretty_printer *buffer, gassign *gs, int spc, int flags)
+dump_binary_rhs (pretty_printer *buffer, gassign *gs, int spc,
+		 dump_flags_t flags)
 {
   const char *p;
   enum tree_code code = gimple_assign_rhs_code (gs);
@@ -433,7 +437,8 @@ dump_binary_rhs (pretty_printer *buffer, gassign *gs, int spc, int flags)
    assignment GS.  BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.  */
 
 static void
-dump_ternary_rhs (pretty_printer *buffer, gassign *gs, int spc, int flags)
+dump_ternary_rhs (pretty_printer *buffer, gassign *gs, int spc,
+		  dump_flags_t flags)
 {
   const char *p;
   enum tree_code code = gimple_assign_rhs_code (gs);
@@ -559,7 +564,8 @@ dump_ternary_rhs (pretty_printer *buffer, gassign *gs, int spc, int flags)
    pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_assign (pretty_printer *buffer, gassign *gs, int spc, int flags)
+dump_gimple_assign (pretty_printer *buffer, gassign *gs, int spc,
+		    dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -620,7 +626,8 @@ dump_gimple_assign (pretty_printer *buffer, gassign *gs, int spc, int flags)
    pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_return (pretty_printer *buffer, greturn *gs, int spc, int flags)
+dump_gimple_return (pretty_printer *buffer, greturn *gs, int spc,
+		    dump_flags_t flags)
 {
   tree t, t2;
 
@@ -650,7 +657,7 @@ dump_gimple_return (pretty_printer *buffer, greturn *gs, int spc, int flags)
    dump_gimple_call.  */
 
 static void
-dump_gimple_call_args (pretty_printer *buffer, gcall *gs, int flags)
+dump_gimple_call_args (pretty_printer *buffer, gcall *gs, dump_flags_t flags)
 {
   size_t i = 0;
 
@@ -806,7 +813,8 @@ pp_points_to_solution (pretty_printer *buffer, struct pt_solution *pt)
    pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_call (pretty_printer *buffer, gcall *gs, int spc, int flags)
+dump_gimple_call (pretty_printer *buffer, gcall *gs, int spc,
+		  dump_flags_t flags)
 {
   tree lhs = gimple_call_lhs (gs);
   tree fn = gimple_call_fn (gs);
@@ -942,7 +950,7 @@ dump_gimple_call (pretty_printer *buffer, gcall *gs, int spc, int flags)
 
 static void
 dump_gimple_switch (pretty_printer *buffer, gswitch *gs, int spc,
-		    int flags)
+		    dump_flags_t flags)
 {
   unsigned int i;
 
@@ -999,7 +1007,8 @@ dump_gimple_switch (pretty_printer *buffer, gswitch *gs, int spc,
    pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_cond (pretty_printer *buffer, gcond *gs, int spc, int flags)
+dump_gimple_cond (pretty_printer *buffer, gcond *gs, int spc,
+		  dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%s, %T, %T, %T, %T>", gs,
@@ -1065,7 +1074,8 @@ dump_gimple_cond (pretty_printer *buffer, gcond *gs, int spc, int flags)
    TDF_* in dumpfils.h).  */
 
 static void
-dump_gimple_label (pretty_printer *buffer, glabel *gs, int spc, int flags)
+dump_gimple_label (pretty_printer *buffer, glabel *gs, int spc,
+		   dump_flags_t flags)
 {
   tree label = gimple_label_label (gs);
   if (flags & TDF_RAW)
@@ -1091,7 +1101,8 @@ dump_gimple_label (pretty_printer *buffer, glabel *gs, int spc, int flags)
    TDF_* in dumpfile.h).  */
 
 static void
-dump_gimple_goto (pretty_printer *buffer, ggoto *gs, int spc, int flags)
+dump_gimple_goto (pretty_printer *buffer, ggoto *gs, int spc,
+		  dump_flags_t flags)
 {
   tree label = gimple_goto_dest (gs);
   if (flags & TDF_RAW)
@@ -1106,7 +1117,8 @@ dump_gimple_goto (pretty_printer *buffer, ggoto *gs, int spc, int flags)
    TDF_* in dumpfile.h).  */
 
 static void
-dump_gimple_bind (pretty_printer *buffer, gbind *gs, int spc, int flags)
+dump_gimple_bind (pretty_printer *buffer, gbind *gs, int spc,
+		  dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <", gs);
@@ -1139,7 +1151,8 @@ dump_gimple_bind (pretty_printer *buffer, gbind *gs, int spc, int flags)
    dumpfile.h).  */
 
 static void
-dump_gimple_try (pretty_printer *buffer, gtry *gs, int spc, int flags)
+dump_gimple_try (pretty_printer *buffer, gtry *gs, int spc,
+		 dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1195,7 +1208,8 @@ dump_gimple_try (pretty_printer *buffer, gtry *gs, int spc, int flags)
    dumpfile.h).  */
 
 static void
-dump_gimple_catch (pretty_printer *buffer, gcatch *gs, int spc, int flags)
+dump_gimple_catch (pretty_printer *buffer, gcatch *gs, int spc,
+		   dump_flags_t flags)
 {
   if (flags & TDF_RAW)
       dump_gimple_fmt (buffer, spc, flags, "%G <%T, %+CATCH <%S>%->", gs,
@@ -1212,7 +1226,7 @@ dump_gimple_catch (pretty_printer *buffer, gcatch *gs, int spc, int flags)
 
 static void
 dump_gimple_eh_filter (pretty_printer *buffer, geh_filter *gs, int spc,
-		       int flags)
+		       dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%T, %+FAILURE <%S>%->", gs,
@@ -1229,7 +1243,7 @@ dump_gimple_eh_filter (pretty_printer *buffer, geh_filter *gs, int spc,
 
 static void
 dump_gimple_eh_must_not_throw (pretty_printer *buffer,
-			       geh_mnt *gs, int spc, int flags)
+			       geh_mnt *gs, int spc, dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%T>", gs,
@@ -1246,7 +1260,7 @@ dump_gimple_eh_must_not_throw (pretty_printer *buffer,
 
 static void
 dump_gimple_eh_else (pretty_printer *buffer, geh_else *gs, int spc,
-		     int flags)
+		     dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags,
@@ -1264,7 +1278,8 @@ dump_gimple_eh_else (pretty_printer *buffer, geh_else *gs, int spc,
    dumpfile.h).  */
 
 static void
-dump_gimple_resx (pretty_printer *buffer, gresx *gs, int spc, int flags)
+dump_gimple_resx (pretty_printer *buffer, gresx *gs, int spc,
+		  dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%d>", gs,
@@ -1276,7 +1291,8 @@ dump_gimple_resx (pretty_printer *buffer, gresx *gs, int spc, int flags)
 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_eh_dispatch (pretty_printer *buffer, geh_dispatch *gs, int spc, int flags)
+dump_gimple_eh_dispatch (pretty_printer *buffer, geh_dispatch *gs, int spc,
+			 dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%d>", gs,
@@ -1291,7 +1307,8 @@ dump_gimple_eh_dispatch (pretty_printer *buffer, geh_dispatch *gs, int spc, int
    in dumpfile.h).  */
 
 static void
-dump_gimple_debug (pretty_printer *buffer, gdebug *gs, int spc, int flags)
+dump_gimple_debug (pretty_printer *buffer, gdebug *gs, int spc,
+		   dump_flags_t flags)
 {
   switch (gs->subcode)
     {
@@ -1324,7 +1341,8 @@ dump_gimple_debug (pretty_printer *buffer, gdebug *gs, int spc, int flags)
 
 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER.  */
 static void
-dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc, int flags)
+dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc,
+		     dump_flags_t flags)
 {
   size_t i;
 
@@ -1476,7 +1494,7 @@ dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc, int flags)
 
 static void
 dump_gimple_omp_continue (pretty_printer *buffer, gomp_continue *gs,
-			  int spc, int flags)
+			  int spc, dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1501,7 +1519,7 @@ dump_gimple_omp_continue (pretty_printer *buffer, gomp_continue *gs,
 
 static void
 dump_gimple_omp_single (pretty_printer *buffer, gomp_single *gs,
-			int spc, int flags)
+			int spc, dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1530,7 +1548,7 @@ dump_gimple_omp_single (pretty_printer *buffer, gomp_single *gs,
 
 static void
 dump_gimple_omp_target (pretty_printer *buffer, gomp_target *gs,
-			int spc, int flags)
+			int spc, dump_flags_t flags)
 {
   const char *kind;
   switch (gimple_omp_target_kind (gs))
@@ -1623,7 +1641,7 @@ dump_gimple_omp_target (pretty_printer *buffer, gomp_target *gs,
 
 static void
 dump_gimple_omp_teams (pretty_printer *buffer, gomp_teams *gs, int spc,
-		       int flags)
+		       dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1652,7 +1670,7 @@ dump_gimple_omp_teams (pretty_printer *buffer, gomp_teams *gs, int spc,
 
 static void
 dump_gimple_omp_sections (pretty_printer *buffer, gomp_sections *gs,
-			  int spc, int flags)
+			  int spc, dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1688,7 +1706,8 @@ dump_gimple_omp_sections (pretty_printer *buffer, gomp_sections *gs,
    pretty_printer BUFFER.  */
 
 static void
-dump_gimple_omp_block (pretty_printer *buffer, gimple *gs, int spc, int flags)
+dump_gimple_omp_block (pretty_printer *buffer, gimple *gs, int spc,
+		       dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S> >", gs,
@@ -1728,7 +1747,7 @@ dump_gimple_omp_block (pretty_printer *buffer, gimple *gs, int spc, int flags)
 
 static void
 dump_gimple_omp_critical (pretty_printer *buffer, gomp_critical *gs,
-			  int spc, int flags)
+			  int spc, dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S> >", gs,
@@ -1760,7 +1779,7 @@ dump_gimple_omp_critical (pretty_printer *buffer, gomp_critical *gs,
 
 static void
 dump_gimple_omp_ordered (pretty_printer *buffer, gomp_ordered *gs,
-			 int spc, int flags)
+			 int spc, dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S> >", gs,
@@ -1784,7 +1803,8 @@ dump_gimple_omp_ordered (pretty_printer *buffer, gomp_ordered *gs,
 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_omp_return (pretty_printer *buffer, gimple *gs, int spc, int flags)
+dump_gimple_omp_return (pretty_printer *buffer, gimple *gs, int spc,
+			dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1815,7 +1835,7 @@ dump_gimple_omp_return (pretty_printer *buffer, gimple *gs, int spc, int flags)
 
 static void
 dump_gimple_transaction (pretty_printer *buffer, gtransaction *gs,
-			 int spc, int flags)
+			 int spc, dump_flags_t flags)
 {
   unsigned subcode = gimple_transaction_subcode (gs);
 
@@ -1916,7 +1936,7 @@ dump_gimple_transaction (pretty_printer *buffer, gtransaction *gs,
    dumpfile.h).  */
 
 static void
-dump_gimple_asm (pretty_printer *buffer, gasm *gs, int spc, int flags)
+dump_gimple_asm (pretty_printer *buffer, gasm *gs, int spc, dump_flags_t flags)
 {
   unsigned int i, n, f, fields;
 
@@ -2134,7 +2154,7 @@ dump_ssaname_info_to_file (FILE *file, tree node, int spc)
 
 static void
 dump_gimple_phi (pretty_printer *buffer, gphi *phi, int spc, bool comment,
-		 int flags)
+		 dump_flags_t flags)
 {
   size_t i;
   tree lhs = gimple_phi_result (phi);
@@ -2198,7 +2218,7 @@ dump_gimple_phi (pretty_printer *buffer, gphi *phi, int spc, bool comment,
 
 static void
 dump_gimple_omp_parallel (pretty_printer *buffer, gomp_parallel *gs,
-			  int spc, int flags)
+			  int spc, dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -2252,7 +2272,7 @@ dump_gimple_omp_parallel (pretty_printer *buffer, gomp_parallel *gs,
 
 static void
 dump_gimple_omp_task (pretty_printer *buffer, gomp_task *gs, int spc,
-		      int flags)
+		      dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -2312,7 +2332,7 @@ dump_gimple_omp_task (pretty_printer *buffer, gomp_task *gs, int spc,
 
 static void
 dump_gimple_omp_atomic_load (pretty_printer *buffer, gomp_atomic_load *gs,
-			     int spc, int flags)
+			     int spc, dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -2345,7 +2365,8 @@ dump_gimple_omp_atomic_load (pretty_printer *buffer, gomp_atomic_load *gs,
 
 static void
 dump_gimple_omp_atomic_store (pretty_printer *buffer,
-			      gomp_atomic_store *gs, int spc, int flags)
+			      gomp_atomic_store *gs, int spc,
+			      dump_flags_t flags)
 {
   if (flags & TDF_RAW)
     {
@@ -2371,7 +2392,8 @@ dump_gimple_omp_atomic_store (pretty_printer *buffer,
    FLAGS are as in pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_mem_ops (pretty_printer *buffer, gimple *gs, int spc, int flags)
+dump_gimple_mem_ops (pretty_printer *buffer, gimple *gs, int spc,
+		     dump_flags_t flags)
 {
   tree vdef = gimple_vdef (gs);
   tree vuse = gimple_vuse (gs);
@@ -2401,7 +2423,8 @@ dump_gimple_mem_ops (pretty_printer *buffer, gimple *gs, int spc, int flags)
    pp_flush on BUFFER to finalize the pretty printer.  */
 
 void
-pp_gimple_stmt_1 (pretty_printer *buffer, gimple *gs, int spc, int flags)
+pp_gimple_stmt_1 (pretty_printer *buffer, gimple *gs, int spc,
+		  dump_flags_t flags)
 {
   if (!gs)
     return;
@@ -2609,7 +2632,8 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple *gs, int spc, int flags)
    spaces and details described by flags.  */
 
 static void
-dump_gimple_bb_header (FILE *outf, basic_block bb, int indent, int flags)
+dump_gimple_bb_header (FILE *outf, basic_block bb, int indent,
+		       dump_flags_t flags)
 {
   if (flags & TDF_BLOCKS)
     {
@@ -2655,7 +2679,7 @@ static void
 dump_gimple_bb_footer (FILE *outf ATTRIBUTE_UNUSED,
 		       basic_block bb ATTRIBUTE_UNUSED,
 		       int indent ATTRIBUTE_UNUSED,
-		       int flags ATTRIBUTE_UNUSED)
+		       dump_flags_t flags ATTRIBUTE_UNUSED)
 {
   /* There is currently no GIMPLE-specific basic block info to dump.  */
   return;
@@ -2666,7 +2690,8 @@ dump_gimple_bb_footer (FILE *outf ATTRIBUTE_UNUSED,
    by FLAGS and indented by INDENT spaces.  */
 
 static void
-dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent, int flags)
+dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent,
+		dump_flags_t flags)
 {
   gphi_iterator i;
 
@@ -2688,7 +2713,7 @@ dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent, int flags)
    to BUFFER.  */
 
 static void
-pp_cfg_jump (pretty_printer *buffer, edge e, int flags)
+pp_cfg_jump (pretty_printer *buffer, edge e, dump_flags_t flags)
 {
   if (flags & TDF_GIMPLE)
     {
@@ -2725,7 +2750,7 @@ pp_cfg_jump (pretty_printer *buffer, edge e, int flags)
 
 static void
 dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent,
-		     int flags)
+		     dump_flags_t flags)
 {
   edge e;
   gimple *stmt;
@@ -2776,7 +2801,7 @@ dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent,
 
 static void
 gimple_dump_bb_buff (pretty_printer *buffer, basic_block bb, int indent,
-		     int flags)
+		     dump_flags_t flags)
 {
   gimple_stmt_iterator gsi;
   gimple *stmt;
@@ -2812,7 +2837,7 @@ gimple_dump_bb_buff (pretty_printer *buffer, basic_block bb, int indent,
    indented by INDENT spaces.  */
 
 void
-gimple_dump_bb (FILE *file, basic_block bb, int indent, int flags)
+gimple_dump_bb (FILE *file, basic_block bb, int indent, dump_flags_t flags)
 {
   dump_gimple_bb_header (file, bb, indent, flags);
   if (bb->index >= NUM_FIXED_BLOCKS)
diff --git a/gcc/gimple-pretty-print.h b/gcc/gimple-pretty-print.h
index 4c1d9258847..0b74d1b0494 100644
--- a/gcc/gimple-pretty-print.h
+++ b/gcc/gimple-pretty-print.h
@@ -26,13 +26,13 @@ along with GCC; see the file COPYING3.  If not see
 /* In gimple-pretty-print.c  */
 extern void debug_gimple_stmt (gimple *);
 extern void debug_gimple_seq (gimple_seq);
-extern void print_gimple_seq (FILE *, gimple_seq, int, int);
-extern void print_gimple_stmt (FILE *, gimple *, int, int = 0);
+extern void print_gimple_seq (FILE *, gimple_seq, int, dump_flags_t);
+extern void print_gimple_stmt (FILE *, gimple *, int, dump_flags_t = TDF_NONE);
 extern void debug (gimple &ref);
 extern void debug (gimple *ptr);
-extern void print_gimple_expr (FILE *, gimple *, int, int = 0);
-extern void pp_gimple_stmt_1 (pretty_printer *, gimple *, int, int);
-extern void gimple_dump_bb (FILE *, basic_block, int, int);
+extern void print_gimple_expr (FILE *, gimple *, int, dump_flags_t = TDF_NONE);
+extern void pp_gimple_stmt_1 (pretty_printer *, gimple *, int, dump_flags_t);
+extern void gimple_dump_bb (FILE *, basic_block, int, dump_flags_t);
 extern void gimple_dump_bb_for_graph (pretty_printer *, basic_block);
 extern void dump_ssaname_info_to_file (FILE *, tree, int);
 
diff --git a/gcc/graph.c b/gcc/graph.c
index 9f075c0a3f2..9261732d23e 100644
--- a/gcc/graph.c
+++ b/gcc/graph.c
@@ -291,9 +291,9 @@ print_graph_cfg (FILE *fp, struct function *fun)
 /* Overload with additional flag argument.  */
 
 void DEBUG_FUNCTION
-print_graph_cfg (FILE *fp, struct function *fun, int flags)
+print_graph_cfg (FILE *fp, struct function *fun, dump_flags_t flags)
 {
-  int saved_dump_flags = dump_flags;
+  dump_flags_t saved_dump_flags = dump_flags;
   dump_flags = flags;
   print_graph_cfg (fp, fun);
   dump_flags = saved_dump_flags;
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index e3a627df46d..2b7604e2e73 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -96,8 +96,8 @@ DEBUG_FUNCTION void
 dot_all_sese (FILE *file, vec<sese_l>& scops)
 {
   /* Disable debugging while printing graph.  */
-  int tmp_dump_flags = dump_flags;
-  dump_flags = 0;
+  dump_flags_t tmp_dump_flags = dump_flags;
+  dump_flags = TDF_NONE;
 
   fprintf (file, "digraph all {\n");
 
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 20e0dd68b4d..2949f92193e 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -2260,7 +2260,7 @@ build_type_inheritance_graph (void)
 {
   struct symtab_node *n;
   FILE *inheritance_dump_file;
-  int flags;
+  dump_flags_t flags;
 
   if (odr_hash)
     return;
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index 3d48a8fb7bc..e2b6add6d41 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -191,7 +191,7 @@ static rtx get_expansion (struct var_to_expand *);
 static void
 report_unroll (struct loop *loop, location_t locus)
 {
-  int report_flags = MSG_OPTIMIZED_LOCATIONS | TDF_RTL | TDF_DETAILS;
+  dump_flags_t report_flags = MSG_OPTIMIZED_LOCATIONS | TDF_RTL | TDF_DETAILS;
 
   if (loop->lpt_decision.decision == LPT_NONE)
     return;
diff --git a/gcc/passes.c b/gcc/passes.c
index 911495ed865..a2fa9f742ee 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -776,7 +776,8 @@ pass_manager::register_one_dump_file (opt_pass *pass)
 
   /* Buffer big enough to format a 32-bit UINT_MAX into.  */
   char num[11];
-  int flags, id;
+  dump_flags_t flags;
+  int id;
   int optgroup_flags = OPTGROUP_NONE;
   gcc::dump_manager *dumps = m_ctxt->get_dumps ();
 
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index e0db2dfe82e..fb58be6c073 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -1007,7 +1007,7 @@ debug_raw (const tree_node *ptr)
 }
 
 static void
-dump_tree_via_hooks (const tree_node *ptr, int options)
+dump_tree_via_hooks (const tree_node *ptr, dump_flags_t options)
 {
   if (DECL_P (ptr))
     lang_hooks.print_decl (stderr, const_cast <tree_node*> (ptr), 0);
diff --git a/gcc/statistics.c b/gcc/statistics.c
index 57344f109b5..ca7551c2170 100644
--- a/gcc/statistics.c
+++ b/gcc/statistics.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "pass_manager.h"
 
 static int statistics_dump_nr;
-static int statistics_dump_flags;
+static dump_flags_t statistics_dump_flags;
 static FILE *statistics_dump_file;
 
 /* Statistics entry.  A integer counter associated to a string ID
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 19283b00833..b588bc03a47 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -2372,7 +2372,7 @@ gimple_debug_bb_n (int n)
    (see TDF_* in dumpfile.h).  */
 
 void
-gimple_debug_cfg (int flags)
+gimple_debug_cfg (dump_flags_t flags)
 {
   gimple_dump_cfg (stderr, flags);
 }
@@ -2384,7 +2384,7 @@ gimple_debug_cfg (int flags)
    tree.h).  */
 
 void
-gimple_dump_cfg (FILE *file, int flags)
+gimple_dump_cfg (FILE *file, dump_flags_t flags)
 {
   if (flags & TDF_DETAILS)
     {
@@ -7514,7 +7514,7 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
    SPC.  */
 
 static void
-dump_default_def (FILE *file, tree def, int spc, int flags)
+dump_default_def (FILE *file, tree def, int spc, dump_flags_t flags)
 {
   for (int i = 0; i < spc; ++i)
     fprintf (file, " ");
@@ -7532,7 +7532,7 @@ dump_default_def (FILE *file, tree def, int spc, int flags)
    */
 
 void
-dump_function_to_file (tree fndecl, FILE *file, int flags)
+dump_function_to_file (tree fndecl, FILE *file, dump_flags_t flags)
 {
   tree arg, var, old_current_fndecl = current_function_decl;
   struct function *dsf;
@@ -7755,7 +7755,7 @@ dump_function_to_file (tree fndecl, FILE *file, int flags)
 /* Dump FUNCTION_DECL FN to stderr using FLAGS (see TDF_* in tree.h)  */
 
 DEBUG_FUNCTION void
-debug_function (tree fn, int flags)
+debug_function (tree fn, dump_flags_t flags)
 {
   dump_function_to_file (fn, stderr, flags);
 }
diff --git a/gcc/tree-cfg.h b/gcc/tree-cfg.h
index a3af5a40567..a0ef479ef20 100644
--- a/gcc/tree-cfg.h
+++ b/gcc/tree-cfg.h
@@ -46,7 +46,7 @@ extern edge find_taken_edge (basic_block, tree);
 extern void gimple_debug_bb (basic_block);
 extern basic_block gimple_debug_bb_n (int);
 extern void gimple_debug_cfg (int);
-extern void gimple_dump_cfg (FILE *, int);
+extern void gimple_dump_cfg (FILE *, dump_flags_t);
 extern void dump_cfg_stats (FILE *);
 extern void debug_cfg_stats (void);
 extern bool computed_goto_p (gimple *);
@@ -79,7 +79,7 @@ extern void verify_sese (basic_block, basic_block, vec<basic_block> *);
 extern bool gather_ssa_name_hash_map_from (tree const &, tree const &, void *);
 extern basic_block move_sese_region_to_fn (struct function *, basic_block,
 				           basic_block, tree);
-extern void dump_function_to_file (tree, FILE *, int);
+extern void dump_function_to_file (tree, FILE *, dump_flags_t);
 extern void debug_function (tree, int) ;
 extern void print_loops_bb (FILE *, basic_block, int, int);
 extern void print_loops (FILE *, int);
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 4e47be1dc05..2e65a4443fc 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -898,7 +898,7 @@ dump_enumerated_decls_push (tree *tp, int *walk_subtrees, void *data)
    FILE is the dump file where to output the list and FLAGS is as in
    print_generic_expr.  */
 void
-dump_enumerated_decls (FILE *file, int flags)
+dump_enumerated_decls (FILE *file, dump_flags_t flags)
 {
   basic_block bb;
   struct walk_stmt_info wi;
diff --git a/gcc/tree-dfa.h b/gcc/tree-dfa.h
index fb1f53fac4d..adaed620487 100644
--- a/gcc/tree-dfa.h
+++ b/gcc/tree-dfa.h
@@ -36,7 +36,7 @@ extern tree get_addr_base_and_unit_offset_1 (tree, HOST_WIDE_INT *,
 extern tree get_addr_base_and_unit_offset (tree, HOST_WIDE_INT *);
 extern bool stmt_references_abnormal_ssa_name (gimple *);
 extern void replace_abnormal_ssa_names (gimple *);
-extern void dump_enumerated_decls (FILE *, int);
+extern void dump_enumerated_decls (FILE *, dump_flags_t);
 
 
 #endif /* GCC_TREE_DFA_H */
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index fd1783e020d..347b33ab505 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -713,7 +713,7 @@ dequeue_and_dump (dump_info_p di)
 /* Return nonzero if FLAG has been specified for the dump, and NODE
    is not the root node of the dump.  */
 
-int dump_flag (dump_info_p di, int flag, const_tree node)
+int dump_flag (dump_info_p di, dump_flags_t flag, const_tree node)
 {
   return (di->flags & flag) && (node != di->node);
 }
@@ -721,7 +721,7 @@ int dump_flag (dump_info_p di, int flag, const_tree node)
 /* Dump T, and all its children, on STREAM.  */
 
 void
-dump_node (const_tree t, int flags, FILE *stream)
+dump_node (const_tree t, dump_flags_t flags, FILE *stream)
 {
   struct dump_info di;
   dump_queue_p dq;
diff --git a/gcc/tree-dump.h b/gcc/tree-dump.h
index 6649ed2548d..448ac83f72b 100644
--- a/gcc/tree-dump.h
+++ b/gcc/tree-dump.h
@@ -60,7 +60,7 @@ struct dump_info
   /* The original node.  */
   const_tree node;
   /* User flags.  */
-  int flags;
+  dump_flags_t flags;
   /* The next unused node index.  */
   unsigned int index;
   /* The next column.  */
@@ -87,6 +87,6 @@ extern void dump_string (dump_info_p, const char *);
 extern void dump_string_field (dump_info_p, const char *, const char *);
 extern void queue_and_dump_index (dump_info_p, const char *, const_tree, int);
 extern void queue_and_dump_type (dump_info_p, const_tree);
-extern int dump_flag (dump_info_p, int, const_tree);
+extern int dump_flag (dump_info_p, dump_flags_t, const_tree);
 
 #endif /* ! GCC_TREE_DUMP_H */
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index d823c2e1245..ec28b1e3c95 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -39,8 +39,8 @@ static const char *op_symbol (const_tree);
 static void pretty_print_string (pretty_printer *, const char*);
 static void newline_and_indent (pretty_printer *, int);
 static void maybe_init_pretty_print (FILE *);
-static void print_struct_decl (pretty_printer *, const_tree, int, int);
-static void do_niy (pretty_printer *, const_tree, int);
+static void print_struct_decl (pretty_printer *, const_tree, int, dump_flags_t);
+static void do_niy (pretty_printer *, const_tree, dump_flags_t);
 
 #define INDENT(SPACE) do { \
   int i; for (i = 0; i<SPACE; i++) pp_space (pp); } while (0)
@@ -52,7 +52,7 @@ static pretty_printer *tree_pp;
 /* Try to print something for an unknown tree code.  */
 
 static void
-do_niy (pretty_printer *pp, const_tree node, int flags)
+do_niy (pretty_printer *pp, const_tree node, dump_flags_t flags)
 {
   int i, len;
 
@@ -115,7 +115,7 @@ debug_tree_chain (tree t)
 
 /* Prints declaration DECL to the FILE with details specified by FLAGS.  */
 void
-print_generic_decl (FILE *file, tree decl, int flags)
+print_generic_decl (FILE *file, tree decl, dump_flags_t flags)
 {
   maybe_init_pretty_print (file);
   print_declaration (tree_pp, decl, 2, flags);
@@ -126,7 +126,7 @@ print_generic_decl (FILE *file, tree decl, int flags)
    to show in the dump.  See TDF_* in dumpfile.h.  */
 
 void
-print_generic_stmt (FILE *file, tree t, int flags)
+print_generic_stmt (FILE *file, tree t, dump_flags_t flags)
 {
   maybe_init_pretty_print (file);
   dump_generic_node (tree_pp, t, 0, flags, true);
@@ -138,7 +138,7 @@ print_generic_stmt (FILE *file, tree t, int flags)
    INDENT spaces.  */
 
 void
-print_generic_stmt_indented (FILE *file, tree t, int flags, int indent)
+print_generic_stmt_indented (FILE *file, tree t, dump_flags_t flags, int indent)
 {
   int i;
 
@@ -154,7 +154,7 @@ print_generic_stmt_indented (FILE *file, tree t, int flags, int indent)
    in the dump.  See TDF_* in dumpfile.h.  */
 
 void
-print_generic_expr (FILE *file, tree t, int flags)
+print_generic_expr (FILE *file, tree t, dump_flags_t flags)
 {
   maybe_init_pretty_print (file);
   dump_generic_node (tree_pp, t, 0, flags, false);
@@ -244,7 +244,7 @@ dump_fancy_name (pretty_printer *pp, tree name)
    in FLAGS.  */
 
 static void
-dump_decl_name (pretty_printer *pp, tree node, int flags)
+dump_decl_name (pretty_printer *pp, tree node, dump_flags_t flags)
 {
   if (DECL_NAME (node))
     {
@@ -290,7 +290,7 @@ dump_decl_name (pretty_printer *pp, tree node, int flags)
 /* Like the above, but used for pretty printing function calls.  */
 
 static void
-dump_function_name (pretty_printer *pp, tree node, int flags)
+dump_function_name (pretty_printer *pp, tree node, dump_flags_t flags)
 {
   if (CONVERT_EXPR_P (node))
     node = TREE_OPERAND (node, 0);
@@ -305,7 +305,7 @@ dump_function_name (pretty_printer *pp, tree node, int flags)
 
 static void
 dump_function_declaration (pretty_printer *pp, tree node,
-			   int spc, int flags)
+			   int spc, dump_flags_t flags)
 {
   bool wrote_arg = false;
   tree arg;
@@ -341,7 +341,7 @@ dump_function_declaration (pretty_printer *pp, tree node,
 /* Dump the domain associated with an array.  */
 
 static void
-dump_array_domain (pretty_printer *pp, tree domain, int spc, int flags)
+dump_array_domain (pretty_printer *pp, tree domain, int spc, dump_flags_t flags)
 {
   pp_left_bracket (pp);
   if (domain)
@@ -372,7 +372,7 @@ dump_array_domain (pretty_printer *pp, tree domain, int spc, int flags)
    dump_generic_node.  */
 
 static void
-dump_omp_clause (pretty_printer *pp, tree clause, int spc, int flags)
+dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
 {
   const char *name;
 
@@ -1051,7 +1051,7 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, int flags)
    dump_generic_node.  */
 
 void
-dump_omp_clauses (pretty_printer *pp, tree clause, int spc, int flags)
+dump_omp_clauses (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
 {
   if (clause == NULL)
     return;
@@ -1092,7 +1092,7 @@ dump_location (pretty_printer *pp, location_t loc)
    dump_generic_node.  */
 
 static void
-dump_block_node (pretty_printer *pp, tree block, int spc, int flags)
+dump_block_node (pretty_printer *pp, tree block, int spc, dump_flags_t flags)
 {
   tree t;
 
@@ -1205,7 +1205,7 @@ dump_block_node (pretty_printer *pp, tree block, int spc, int flags)
    to be a statement and it is terminated by ';' if appropriate.  */
 
 int
-dump_generic_node (pretty_printer *pp, tree node, int spc, int flags,
+dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
 		   bool is_stmt)
 {
   tree type;
@@ -3313,7 +3313,7 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, int flags,
 /* Print the declaration of a variable.  */
 
 void
-print_declaration (pretty_printer *pp, tree t, int spc, int flags)
+print_declaration (pretty_printer *pp, tree t, int spc, dump_flags_t flags)
 {
   INDENT (spc);
 
@@ -3414,7 +3414,8 @@ print_declaration (pretty_printer *pp, tree t, int spc, int flags)
    FIXME: Still incomplete.  */
 
 static void
-print_struct_decl (pretty_printer *pp, const_tree node, int spc, int flags)
+print_struct_decl (pretty_printer *pp, const_tree node, int spc,
+		   dump_flags_t flags)
 {
   /* Print the name of the structure.  */
   if (TYPE_NAME (node))
@@ -3810,7 +3811,7 @@ op_symbol (const_tree op)
    the gimple_call_fn of a GIMPLE_CALL.  */
 
 void
-print_call_name (pretty_printer *pp, tree node, int flags)
+print_call_name (pretty_printer *pp, tree node, dump_flags_t flags)
 {
   tree op0 = node;
 
@@ -4050,7 +4051,7 @@ pp_tree_identifier (pretty_printer *pp, tree id)
    function dump.  */
 
 void
-dump_function_header (FILE *dump_file, tree fdecl, int flags)
+dump_function_header (FILE *dump_file, tree fdecl, dump_flags_t flags)
 {
   const char *dname, *aname;
   struct cgraph_node *node = cgraph_node::get (fdecl);
diff --git a/gcc/tree-pretty-print.h b/gcc/tree-pretty-print.h
index 0af1acc609a..07270b735a7 100644
--- a/gcc/tree-pretty-print.h
+++ b/gcc/tree-pretty-print.h
@@ -34,20 +34,20 @@ along with GCC; see the file COPYING3.  If not see
 extern void debug_generic_expr (tree);
 extern void debug_generic_stmt (tree);
 extern void debug_tree_chain (tree);
-extern void print_generic_decl (FILE *, tree, int);
-extern void print_generic_stmt (FILE *, tree, int = 0);
-extern void print_generic_stmt_indented (FILE *, tree, int, int);
-extern void print_generic_expr (FILE *, tree, int = 0);
-extern void dump_omp_clauses (pretty_printer *, tree, int, int);
-extern int dump_generic_node (pretty_printer *, tree, int, int, bool);
-extern void print_declaration (pretty_printer *, tree, int, int);
+extern void print_generic_decl (FILE *, tree, dump_flags_t);
+extern void print_generic_stmt (FILE *, tree, dump_flags_t = TDF_NONE);
+extern void print_generic_stmt_indented (FILE *, tree, dump_flags_t, int);
+extern void print_generic_expr (FILE *, tree, dump_flags_t = TDF_NONE);
+extern void dump_omp_clauses (pretty_printer *, tree, int, dump_flags_t);
+extern int dump_generic_node (pretty_printer *, tree, int, dump_flags_t, bool);
+extern void print_declaration (pretty_printer *, tree, int, dump_flags_t);
 extern int op_code_prio (enum tree_code);
 extern int op_prio (const_tree);
 extern const char *op_symbol_code (enum tree_code);
-extern void print_call_name (pretty_printer *, tree, int);
+extern void print_call_name (pretty_printer *, tree, dump_flags_t);
 extern void percent_K_format (text_info *);
 extern void pp_tree_identifier (pretty_printer *, tree);
-extern void dump_function_header (FILE *, tree, int);
+extern void dump_function_header (FILE *, tree, dump_flags_t);
 extern void pp_double_int (pretty_printer *pp, double_int d, bool uns);
 extern void dump_location (pretty_printer *buffer, location_t loc);
 
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 0b992dba130..c77075e4ac6 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -613,7 +613,7 @@ clear_unused_block_pointer (void)
    indentation level and FLAGS is as in print_generic_expr.  */
 
 static void
-dump_scope_block (FILE *file, int indent, tree scope, int flags)
+dump_scope_block (FILE *file, int indent, tree scope, dump_flags_t flags)
 {
   tree var, t;
   unsigned int i;
@@ -661,7 +661,7 @@ dump_scope_block (FILE *file, int indent, tree scope, int flags)
    is as in print_generic_expr.  */
 
 DEBUG_FUNCTION void
-debug_scope_block (tree scope, int flags)
+debug_scope_block (tree scope, dump_flags_t flags)
 {
   dump_scope_block (stderr, 0, scope, flags);
 }
@@ -671,7 +671,7 @@ debug_scope_block (tree scope, int flags)
    FLAGS is as in print_generic_expr.  */
 
 void
-dump_scope_blocks (FILE *file, int flags)
+dump_scope_blocks (FILE *file, dump_flags_t flags)
 {
   dump_scope_block (file, 0, DECL_INITIAL (current_function_decl), flags);
 }
@@ -681,7 +681,7 @@ dump_scope_blocks (FILE *file, int flags)
    FLAGS is as in print_generic_expr.  */
 
 DEBUG_FUNCTION void
-debug_scope_blocks (int flags)
+debug_scope_blocks (dump_flags_t flags)
 {
   dump_scope_blocks (stderr, flags);
 }
diff --git a/gcc/tree-ssa-live.h b/gcc/tree-ssa-live.h
index 6685befcb97..dd9ca799597 100644
--- a/gcc/tree-ssa-live.h
+++ b/gcc/tree-ssa-live.h
@@ -73,9 +73,9 @@ extern void delete_var_map (var_map);
 extern int var_union (var_map, tree, tree);
 extern void partition_view_normal (var_map);
 extern void partition_view_bitmap (var_map, bitmap);
-extern void dump_scope_blocks (FILE *, int);
-extern void debug_scope_block (tree, int);
-extern void debug_scope_blocks (int);
+extern void dump_scope_blocks (FILE *, dump_flags_t);
+extern void debug_scope_block (tree, dump_flags_t);
+extern void debug_scope_blocks (dump_flags_t);
 extern void remove_unused_locals (void);
 extern void dump_var_map (FILE *, var_map);
 extern void debug (_var_map &ref);
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index e09ac29a58b..0a38c0a36d6 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -686,7 +686,7 @@ try_unroll_loop_completely (struct loop *loop,
   struct loop_size size;
   bool n_unroll_found = false;
   edge edge_to_cancel = NULL;
-  int report_flags = MSG_OPTIMIZED_LOCATIONS | TDF_RTL | TDF_DETAILS;
+  dump_flags_t report_flags = MSG_OPTIMIZED_LOCATIONS | TDF_RTL | TDF_DETAILS;
 
   /* See if we proved number of iterations to be low constant.
 
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index af874e7ad8e..b41abf3335c 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2432,7 +2432,7 @@ reduction_code_for_scalar_code (enum tree_code code,
    STMT is printed with a message MSG. */
 
 static void
-report_vect_op (int msg_type, gimple *stmt, const char *msg)
+report_vect_op (dump_flags_t msg_type, gimple *stmt, const char *msg)
 {
   dump_printf_loc (msg_type, vect_location, "%s", msg);
   dump_gimple_stmt (msg_type, TDF_SLIM, stmt, 0);
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index e254aa0e49f..d221fc63873 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1220,7 +1220,7 @@ fail:
 /* Dump a slp tree NODE using flags specified in DUMP_KIND.  */
 
 static void
-vect_print_slp_tree (int dump_kind, location_t loc, slp_tree node)
+vect_print_slp_tree (dump_flags_t dump_kind, location_t loc, slp_tree node)
 {
   int i;
   gimple *stmt;
-- 
2.12.2

