aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErven Rohou <erven.rohou@inria.fr>2010-06-18 07:30:06 +0000
committerErven Rohou <erven.rohou@inria.fr>2010-06-18 07:30:06 +0000
commit7f7b3bed1ef39f180f9a68ae07241fadeccbcba7 (patch)
treeee5c28b841bd5bb92b8f4ce690cd81bbf1217bfe
parent515995aaf745199f117bfb451015a9b9baf022ff (diff)
Add dump functions for CLI passes.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/st/cli-be@160960 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog17
-rw-r--r--gcc/config/cil32/cil-dump.c165
-rw-r--r--gcc/config/cil32/cil-lower.c4
-rw-r--r--gcc/config/cil32/cil32.h3
-rw-r--r--gcc/config/cil32/emit-cil.c8
-rw-r--r--gcc/config/cil32/gimple-to-cil.c4
-rw-r--r--gcc/config/cil32/missing-protos.c4
-rw-r--r--gcc/config/cil32/peephole.c4
-rw-r--r--gcc/config/cil32/remove-convs.c4
-rw-r--r--gcc/config/cil32/remove-temps.c4
-rw-r--r--gcc/config/cil32/simp-cond.c4
-rw-r--r--gcc/passes.c4
-rw-r--r--gcc/tree-pass.h1
13 files changed, 124 insertions, 102 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c7a99eb00ea..5e5a7313e05 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+2010-06-18 Erven Rohou <erven.rohou@inria.fr>
+
+ * tree-pass.h: Add CIL property.
+ * passes.c: Map CIL property to dump function.
+ * config/cil32/cil-dump.c: Dump functions dump to FILE*.
+ * config/cil32/gimple-to-cil.c: Provides property CIL.
+ * config/cil32/missing-protos.c: Requires CIL property.
+ * config/cil32/peephole.c: Likewise.
+ * config/cil32/remove-temps.c: Likewise.
+ * config/cil32/remove-convs.c: Likewise.
+ * config/cil32/simp-cond.c: Likewise.
+ * config/cil32/cil-lower.c: Likewise.
+ * config/cil32/emit-cil.c: Likewise.
+ * config/cil32/cil32.h: Declare dump functions.
+
2010-02-12 Erven Rohou <erven.rohou@inria.fr>
* config/cil32/cil-builtins.def: Fix incorrect builtin parameter type.
@@ -17,7 +32,7 @@
* config/cil32/cil32.md: Add vector multiply insn.
* config/cil32/cil-lower.c (lower_cil_vector_mul): Lower vector multiply.
* libgcc4net/vector.cs: Implement to semantics of the vector mul.
-
+
2009-03-27 Xinliang David Li <davidxl@google.com>
PR tree-optimization/39557
diff --git a/gcc/config/cil32/cil-dump.c b/gcc/config/cil32/cil-dump.c
index 43f7608921d..0fb47be930e 100644
--- a/gcc/config/cil32/cil-dump.c
+++ b/gcc/config/cil32/cil-dump.c
@@ -44,13 +44,14 @@ Erven Rohou <erven.rohou@inria.fr>
#include "cil-stack.h"
-void dump_cil (void);
-static void dump_cil_stmt (const_cil_stmt stmt, cil_stack stack);
-static void dump_label_name (const_tree);
-static void dump_decl_name (const_tree);
-static void dump_valuetype_name (const_tree);
-static void dump_fun (const_tree);
-static void dump_type (const_tree type);
+void dump_cil_function_to_file (tree fn, FILE *file, int flags);
+
+void dump_cil_stmt (FILE * file, const_cil_stmt stmt, cil_stack stack);
+void dump_cil_label_name (FILE *, const_tree);
+void dump_cil_decl_name (FILE *, const_tree);
+void dump_cil_valuetype_name (FILE *, const_tree);
+void dump_cil_fun_signature (FILE *, const_tree);
+void dump_cil_type (FILE *, const_tree type);
static const char* const cil_names[] = {
@@ -67,29 +68,29 @@ static const char* const cil_type_names[] = {
/* Dump the name of a label. */
-static void
-dump_label_name (const_tree label)
+void
+dump_cil_label_name (FILE * file, const_tree label)
{
- printf ("?L" HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) LABEL_DECL_UID (label));
+ fprintf (file, "?L" HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) LABEL_DECL_UID (label));
}
/* Dump the name of a _DECL node pointed by NODE. */
-static void
-dump_decl_name (const_tree node)
+void
+dump_cil_decl_name (FILE * file, const_tree node)
{
if (DECL_ASSEMBLER_NAME_SET_P (node) || DECL_NAME (node))
- printf ("'%s'",IDENTIFIER_POINTER (DECL_NAME (node)));
+ fprintf (file, "'%s'",IDENTIFIER_POINTER (DECL_NAME (node)));
else
- printf ("'?UNNAMED%d'", DECL_UID (node));
+ fprintf (file, "'?UNNAMED%d'", DECL_UID (node));
}
/* Dump the name of a valuetype.
T must be an aggregate type or an enumeral type, since these are
the types emitted as CIL valuetypes. */
-static void
-dump_valuetype_name (const_tree t)
+void
+dump_cil_valuetype_name (FILE * file, const_tree t)
{
tree name = TYPE_NAME (t);
const char *str = NULL;
@@ -101,17 +102,17 @@ dump_valuetype_name (const_tree t)
str = IDENTIFIER_POINTER (DECL_NAME (name));
if (str)
- printf ("'%s'", str);
+ fprintf (file, "'%s'", str);
else
- printf ("'?UNNAMED%d'", DECL_UID (name));
+ fprintf (file, "'?UNNAMED%d'", DECL_UID (name));
}
/* Dump the signature of function type FUN_TYPE.
The function name that is dumped is taken from function_decl FUN.
FUN must be a FUNCTION_DECL. */
-static void
-dump_fun (const_tree fun)
+void
+dump_cil_fun_signature (FILE * file, const_tree fun)
{
tree fun_type = TREE_TYPE (fun);
tree args_type;
@@ -128,50 +129,50 @@ dump_fun (const_tree fun)
varargs = true;
}
- printf ("%s", varargs ? "vararg " : "");
- dump_type (TREE_TYPE (fun_type));
- printf (" '%s'(", IDENTIFIER_POINTER (DECL_NAME (fun)));
+ fprintf (file, "%s", varargs ? "vararg " : "");
+ dump_cil_type (file, TREE_TYPE (fun_type));
+ fprintf (file, " '%s'(", IDENTIFIER_POINTER (DECL_NAME (fun)));
while (args_type != last_arg_type)
{
- dump_type (TREE_VALUE (args_type));
+ dump_cil_type (file, TREE_VALUE (args_type));
args_type = TREE_CHAIN (args_type);
if (args_type != last_arg_type)
- printf (", ");
+ fprintf (file, ", ");
}
- printf (")");
+ fprintf (file, ")");
}
/* Dump type TYPE.
NODE must be a type node. */
-static void
-dump_type (const_tree type)
+void
+dump_cil_type (FILE * file, const_tree type)
{
if (cil_value_type_p (type))
{
- printf ("value_type ");
- dump_valuetype_name (TYPE_MAIN_VARIANT (type));
+ fprintf (file, "value_type ");
+ dump_cil_valuetype_name (file, TYPE_MAIN_VARIANT (type));
}
else if (cil_pointer_type_p (type))
{
if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
{
- printf ("method_pointer");
+ fprintf (file, "method_pointer");
}
else
{
- dump_type (TREE_TYPE (type));
- printf (" *");
+ dump_cil_type (file, TREE_TYPE (type));
+ fprintf (file, " *");
}
}
else
{
cil_type_t cil_type = type_to_cil (type);
- printf ("%s", cil_type_names [cil_type]);
+ fprintf (file, "%s", cil_type_names [cil_type]);
}
}
@@ -179,8 +180,8 @@ dump_type (const_tree type)
the stack depth and the type of the top-of-stack BEFORE the statement is
executed. */
-static void
-dump_cil_stmt (const_cil_stmt stmt, cil_stack stack)
+void
+dump_cil_stmt (FILE * file, const_cil_stmt stmt, cil_stack stack)
{
enum cil_opcode opcode = cil_opcode (stmt);
@@ -193,29 +194,29 @@ dump_cil_stmt (const_cil_stmt stmt, cil_stack stack)
else
top_type = "<empty>";
- printf ("\n[%d] %-11s %s", depth, top_type, cil_names[opcode]);
+ fprintf (file, "\n[%d] %-11s %s", depth, top_type, cil_names[opcode]);
}
else
{
- printf ("\n\t%s", cil_names[opcode]);
+ fprintf (file, "\n\t%s", cil_names[opcode]);
}
if (cil_prefix_volatile (stmt))
- printf (" volatile");
+ fprintf (file, " volatile");
if (cil_prefix_unaligned (stmt) != 0)
- printf (" unaligned %d", cil_prefix_unaligned (stmt));
+ fprintf (file, " unaligned %d", cil_prefix_unaligned (stmt));
if ((opcode == CIL_VEC_CTOR) && cil_short_ctor (stmt))
- printf (" short ctor");
+ fprintf (file, " short ctor");
switch (opcode_arg_type (opcode))
{
case CIL_VAR:
- printf ("\t");
- dump_decl_name (cil_var (stmt));
+ fprintf (file, "\t");
+ dump_cil_decl_name (file, cil_var (stmt));
break;
case CIL_TYPE:
- dump_type (cil_type (stmt));
+ dump_cil_type (file, cil_type (stmt));
break;
case CIL_FIELD:
@@ -227,38 +228,38 @@ dump_cil_stmt (const_cil_stmt stmt, cil_stack stack)
tree domain = TYPE_DOMAIN (TREE_TYPE (field));
tree max = TYPE_MAX_VALUE (domain);
HOST_WIDE_INT fsize = tree_low_cst (max, 1) + 1;
- printf ("string_type"HOST_WIDE_INT_PRINT_UNSIGNED" '?string%u'",
+ fprintf (file, "string_type"HOST_WIDE_INT_PRINT_UNSIGNED" '?string%u'",
fsize, get_string_cst_id (field));
}
else
{
- printf(" ");
+ fprintf (file, " ");
if (COMPLETE_TYPE_P (TREE_TYPE (field)))
- dump_type (TREE_TYPE (field));
+ dump_cil_type (file, TREE_TYPE (field));
else
- printf ("%s(incomplete_type)", cil_type_names [CIL_NATIVE_INT]);
- printf (" ");
+ fprintf (file, "%s(incomplete_type)", cil_type_names [CIL_NATIVE_INT]);
+ fprintf (file, " ");
switch (opcode)
{
case CIL_LDFLD:
case CIL_LDFLDA:
case CIL_STFLD:
- dump_valuetype_name (DECL_FIELD_CONTEXT (field));
- printf ("::");
+ dump_cil_valuetype_name (file, DECL_FIELD_CONTEXT (field));
+ fprintf (file, "::");
break;
default:
break;
}
- dump_decl_name (field);
+ dump_cil_decl_name (file, field);
}
}
break;
case CIL_LABEL:
- dump_label_name (cil_label (stmt));
+ dump_cil_label_name (file, cil_label (stmt));
break;
case CIL_LABELS:
@@ -267,48 +268,48 @@ dump_cil_stmt (const_cil_stmt stmt, cil_stack stack)
unsigned int n_cases = cil_switch_ncases (stmt);
unsigned HOST_WIDE_INT i;
- printf ("\t(\n");
- printf ("\t\tdefault: ");
- dump_label_name (CASE_LABEL (cil_switch_default (stmt)));
- printf ("\n");
+ fprintf (file, "\t(\n");
+ fprintf (file, "\t\tdefault: ");
+ dump_cil_label_name (file, CASE_LABEL (cil_switch_default (stmt)));
+ fprintf (file, "\n");
for (i = 0; i < n_cases - 1; i++)
{
HOST_WIDE_INT lo = cil_switch_case_low (stmt, i);
HOST_WIDE_INT hi = cil_switch_case_high (stmt, i);
- printf ("\t\t["HOST_WIDE_INT_PRINT_UNSIGNED"-"HOST_WIDE_INT_PRINT_UNSIGNED"]: ",
+ fprintf (file, "\t\t["HOST_WIDE_INT_PRINT_UNSIGNED"-"HOST_WIDE_INT_PRINT_UNSIGNED"]: ",
lo, hi);
- dump_label_name (cil_switch_case_label (stmt, i));
- printf ("\n");
+ dump_cil_label_name (file, cil_switch_case_label (stmt, i));
+ fprintf (file, "\n");
}
- printf ("\t\t)");
+ fprintf (file, "\t\t)");
}
break;
case CIL_FUNC:
- dump_fun (cil_func (stmt));
+ dump_cil_fun_signature (file, cil_func (stmt));
break;
case CIL_FCALL:
{
tree fdecl = cil_call_fdecl (stmt);
- printf("\t");
+ fprintf (file, "\t");
if (cil_prefix_tail (stmt))
- printf ("tailcall");
+ fprintf (file, "tailcall");
if (DECL_BUILT_IN (fdecl))
- printf ("builtin ");
+ fprintf (file, "builtin ");
if (cil_call_vararg_p (stmt))
- printf("vararg ");
+ fprintf (file, "vararg ");
if (DECL_BUILT_IN (fdecl) && DECL_BUILT_IN_CLASS (fdecl) == BUILT_IN_MD)
- printf ("%s", IDENTIFIER_POINTER (DECL_NAME (fdecl)));
+ fprintf (file, "%s", IDENTIFIER_POINTER (DECL_NAME (fdecl)));
else
- dump_decl_name (fdecl);
+ dump_cil_decl_name (file, fdecl);
}
break;
@@ -317,8 +318,8 @@ dump_cil_stmt (const_cil_stmt stmt, cil_stack stack)
{
case CIL_LDC_I4:
case CIL_LDC_I8:
- printf ("\t");
- dump_double_int (stdout, TREE_INT_CST (cil_cst (stmt)), false);
+ fprintf (file, "\t");
+ dump_double_int (file, TREE_INT_CST (cil_cst (stmt)), false);
break;
case CIL_LDC_R4:
@@ -331,7 +332,7 @@ dump_cil_stmt (const_cil_stmt stmt, cil_stack stack)
real_to_target (buf, &d, TYPE_MODE (type));
real_to_decimal (string, &d, sizeof (string), 0, 1);
- printf ("\t(%#08lx%08lx)\t/* %s */", buf[1], buf[0], string);
+ fprintf (file, "\t(%#08lx%08lx)\t/* %s */", buf[1], buf[0], string);
}
break;
@@ -342,7 +343,7 @@ dump_cil_stmt (const_cil_stmt stmt, cil_stack stack)
case CIL_STRING:
gcc_assert (opcode == CIL_ASM);
- printf ("\n\t// BEGIN ASM"
+ fprintf (file, "\n\t// BEGIN ASM"
"\n\t%s"
"\n\t// END ASM",
TREE_STRING_POINTER (cil_string (stmt)));
@@ -360,8 +361,8 @@ dump_cil_stmt (const_cil_stmt stmt, cil_stack stack)
/* Dump the IR for a given basic block. The state of the stack is updated
after each statement. */
-static void
-dump_cil_bb (basic_block bb, cil_stack stack)
+void
+dump_cil_bb (FILE * file, basic_block bb, cil_stack stack)
{
cil_stmt_iterator csi;
cil_stmt stmt = NULL;
@@ -369,14 +370,14 @@ dump_cil_bb (basic_block bb, cil_stack stack)
/* Dump this block label */
label = gimple_block_label (bb);
- printf ("\n");
- dump_label_name (label);
- printf (":\n");
+ fprintf (file, "\n");
+ dump_cil_label_name (file, label);
+ fprintf (file, ":\n");
for (csi = csi_start_bb (bb); !csi_end_p (csi); csi_next (&csi))
{
stmt = csi_stmt (csi);
- dump_cil_stmt (stmt, stack);
+ dump_cil_stmt (file, stmt, stack);
cil_stack_after_stmt (stack, stmt);
}
}
@@ -385,7 +386,7 @@ dump_cil_bb (basic_block bb, cil_stack stack)
/* Dump the IR for the current function. */
void
-dump_cil (void)
+dump_cil_function_to_file (tree fn, FILE *file, int flags __attribute__((unused)))
{
basic_block bb;
cil_bb_stacks bbs;
@@ -393,14 +394,14 @@ dump_cil (void)
bbs = cil_bb_stacks_create ();
- printf ("%s:", lang_hooks.decl_printable_name (current_function_decl, 1));
+ fprintf (file, "%s:", lang_hooks.decl_printable_name (fn, 1));
FOR_EACH_BB (bb)
{
stack = cil_stack_for_bb (bbs, bb);
- dump_cil_bb (bb, stack);
+ dump_cil_bb (file, bb, stack);
}
- printf ("\n");
+ fprintf (file, "\n");
}
/*
diff --git a/gcc/config/cil32/cil-lower.c b/gcc/config/cil32/cil-lower.c
index 68c32d022ec..639cec54102 100644
--- a/gcc/config/cil32/cil-lower.c
+++ b/gcc/config/cil32/cil-lower.c
@@ -662,11 +662,11 @@ struct gimple_opt_pass pass_lower_cil =
NULL, /* next */
0, /* static_pass_number */
TV_LOWER_CIL, /* tv_id */
- PROP_cfg, /* properties_required */
+ PROP_cfg|PROP_cil, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- 0 /* todo_flags_finish */
+ TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/config/cil32/cil32.h b/gcc/config/cil32/cil32.h
index 1d07b93b1c2..f80cb5cbf41 100644
--- a/gcc/config/cil32/cil32.h
+++ b/gcc/config/cil32/cil32.h
@@ -564,6 +564,9 @@ extern struct gimple_opt_pass pass_lower_cil;
extern struct gimple_opt_pass pass_emit_cil_vcg;
extern struct gimple_opt_pass pass_emit_cil;
+/* In cil-dump.c: */
+extern void dump_cil_function_to_file (tree, FILE *, int);
+
/*
* Local variables:
* eval: (c-set-style "gnu")
diff --git a/gcc/config/cil32/emit-cil.c b/gcc/config/cil32/emit-cil.c
index 7a3832cfd2d..05ea60f8aa7 100644
--- a/gcc/config/cil32/emit-cil.c
+++ b/gcc/config/cil32/emit-cil.c
@@ -2068,11 +2068,11 @@ struct gimple_opt_pass pass_emit_cil =
NULL, /* next */
0, /* static_pass_number */
TV_EMIT_CIL, /* tv_id */
- PROP_cfg, /* properties_required */
+ PROP_cfg|PROP_cil, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- 0 /* todo_flags_finish */
+ TODO_dump_func /* todo_flags_finish */
}
};
@@ -2176,11 +2176,11 @@ struct gimple_opt_pass pass_emit_cil_vcg =
NULL, /* next */
0, /* static_pass_number */
TV_EMIT_CIL_VCG, /* tv_id */
- PROP_cfg, /* properties_required */
+ PROP_cfg|PROP_cil, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- 0 /* todo_flags_finish */
+ TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/config/cil32/gimple-to-cil.c b/gcc/config/cil32/gimple-to-cil.c
index 7387dadb380..f5eb5572fea 100644
--- a/gcc/config/cil32/gimple-to-cil.c
+++ b/gcc/config/cil32/gimple-to-cil.c
@@ -4561,10 +4561,10 @@ struct gimple_opt_pass pass_gimple_to_cil =
0, /* static_pass_number */
TV_GIMPLE_TO_CIL, /* tv_id */
PROP_cfg, /* properties_required */
- 0, /* properties_provided */
+ PROP_cil, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_ggc_collect|TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/config/cil32/missing-protos.c b/gcc/config/cil32/missing-protos.c
index d6736bd49c5..bb17b3bc250 100644
--- a/gcc/config/cil32/missing-protos.c
+++ b/gcc/config/cil32/missing-protos.c
@@ -218,11 +218,11 @@ struct gimple_opt_pass pass_missing_protos =
NULL, /* next */
0, /* static_pass_number */
TV_MISSING_PROTOS, /* tv_id */
- PROP_cfg, /* properties_required */
+ PROP_cfg|PROP_cil, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_ggc_collect|TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/config/cil32/peephole.c b/gcc/config/cil32/peephole.c
index 046e13ac9e4..9267ebf80d1 100644
--- a/gcc/config/cil32/peephole.c
+++ b/gcc/config/cil32/peephole.c
@@ -137,11 +137,11 @@ struct gimple_opt_pass pass_cil_peephole =
NULL, /* next */
0, /* static_pass_number */
TV_CIL_PEEPHOLE, /* tv_id */
- PROP_cfg, /* properties_required */
+ PROP_cfg|PROP_cil, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_ggc_collect|TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/config/cil32/remove-convs.c b/gcc/config/cil32/remove-convs.c
index 067e8246465..17acdc9140d 100644
--- a/gcc/config/cil32/remove-convs.c
+++ b/gcc/config/cil32/remove-convs.c
@@ -320,11 +320,11 @@ struct gimple_opt_pass pass_remove_convs =
NULL, /* next */
0, /* static_pass_number */
TV_REMOVE_CONVS, /* tv_id */
- PROP_cfg, /* properties_required */
+ PROP_cfg|PROP_cil, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_ggc_collect|TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/config/cil32/remove-temps.c b/gcc/config/cil32/remove-temps.c
index 5e9f0ee5cf9..a09478d82eb 100644
--- a/gcc/config/cil32/remove-temps.c
+++ b/gcc/config/cil32/remove-temps.c
@@ -825,11 +825,11 @@ struct gimple_opt_pass pass_remove_temps =
NULL, /* next */
0, /* static_pass_number */
TV_REMOVE_TEMPS, /* tv_id */
- PROP_cfg, /* properties_required */
+ PROP_cfg|PROP_cil, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_ggc_collect|TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/config/cil32/simp-cond.c b/gcc/config/cil32/simp-cond.c
index a2adcc7020e..a5bda65acdc 100644
--- a/gcc/config/cil32/simp-cond.c
+++ b/gcc/config/cil32/simp-cond.c
@@ -225,11 +225,11 @@ struct gimple_opt_pass pass_simp_cond =
NULL, /* next */
0, /* static_pass_number */
TV_SIMP_COND, /* tv_id */
- PROP_cfg, /* properties_required */
+ PROP_cfg|PROP_cil, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_ggc_collect|TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/passes.c b/gcc/passes.c
index a65d2a59e16..184443392c1 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -971,7 +971,9 @@ execute_function_todo (void *data)
if ((flags & TODO_dump_func) && dump_file && current_function_decl)
{
- if (cfun->curr_properties & PROP_trees)
+ if (cfun->curr_properties & PROP_cil)
+ dump_cil_function_to_file (current_function_decl, dump_file, dump_flags);
+ else if (cfun->curr_properties & PROP_trees)
dump_function_to_file (current_function_decl, dump_file, dump_flags);
else
{
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index db437a62538..8ee31c29ef1 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -210,6 +210,7 @@ struct dump_file_info
#define PROP_rtl (1 << 7)
#define PROP_alias (1 << 8)
#define PROP_gimple_lomp (1 << 9) /* lowered OpenMP directives */
+#define PROP_cil (1 << 10) /* Common Intermediate Language representation */
#define PROP_trees \
(PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp)