summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-31 08:54:05 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-31 08:54:05 +0000
commit67b7c1c4fbf05260c93ab995ab5c99a0fa4d5e3a (patch)
tree1201645f0a06438d350f307006cd61246b1b0ecd
parentdadc219c1a246e9e101bfd2d6728e948c05a0ce0 (diff)
downloadgcc-67b7c1c4fbf05260c93ab995ab5c99a0fa4d5e3a.tar.gz
Learn GIMPLE pretty printer to produce nicer dump output.
2017-07-31 Martin Liska <mliska@suse.cz> * gimple-pretty-print.c (dump_gimple_label): Never dump BB info. (dump_gimple_bb_header): Always dump BB info. (pp_cfg_jump): Do not append info about BB when dumping a jump. 2017-07-31 Martin Liska <mliska@suse.cz> * gcc.dg/builtin-unreachable-6.c: Update scanned patterns. * gcc.dg/tree-ssa/attr-hotcold-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250731 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/gimple-pretty-print.c33
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/builtin-unreachable-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c4
5 files changed, 22 insertions, 29 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7da2b65fdc2..ef014763332 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2017-07-31 Martin Liska <mliska@suse.cz>
+ * gimple-pretty-print.c (dump_gimple_label): Never dump
+ BB info.
+ (dump_gimple_bb_header): Always dump BB info.
+ (pp_cfg_jump): Do not append info about BB when dumping a jump.
+
+2017-07-31 Martin Liska <mliska@suse.cz>
+
PR sanitize/81530
* convert.c (convert_to_integer_1): Guard condition with flag_sanitize_p
also with current_function_decl non-null equality.
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index c8eb9c4a7bf..8b69b72e9e2 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -1120,9 +1120,6 @@ dump_gimple_label (pretty_printer *buffer, glabel *gs, int spc,
else
{
dump_generic_node (buffer, label, spc, flags, false);
- basic_block bb = gimple_bb (gs);
- if (bb && !(flags & TDF_GIMPLE))
- pp_scalar (buffer, " %s", dump_profile (bb->frequency, bb->count));
pp_colon (buffer);
}
if (flags & TDF_GIMPLE)
@@ -2695,16 +2692,12 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent,
}
else
{
- gimple *stmt = first_stmt (bb);
- if (!stmt || gimple_code (stmt) != GIMPLE_LABEL)
- {
- if (flags & TDF_GIMPLE)
- fprintf (outf, "%*sbb_%d:\n", indent, "", bb->index);
- else
- fprintf (outf, "%*s<bb %d> %s:\n",
- indent, "", bb->index, dump_profile (bb->frequency,
- bb->count));
- }
+ if (flags & TDF_GIMPLE)
+ fprintf (outf, "%*sbb_%d:\n", indent, "", bb->index);
+ else
+ fprintf (outf, "%*s<bb %d> %s:\n",
+ indent, "", bb->index, dump_profile (bb->frequency,
+ bb->count));
}
}
@@ -2760,22 +2753,10 @@ pp_cfg_jump (pretty_printer *buffer, edge e, dump_flags_t flags)
}
else
{
- gimple *stmt = first_stmt (e->dest);
-
pp_string (buffer, "goto <bb ");
pp_decimal_int (buffer, e->dest->index);
pp_greater (buffer);
- if (stmt && gimple_code (stmt) == GIMPLE_LABEL)
- {
- pp_string (buffer, " (");
- dump_generic_node (buffer,
- gimple_label_label (as_a <glabel *> (stmt)),
- 0, 0, false);
- pp_right_paren (buffer);
- pp_semicolon (buffer);
- }
- else
- pp_semicolon (buffer);
+ pp_semicolon (buffer);
dump_edge_probability (buffer, e);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f0ef3ade899..f77d27ce53d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2017-07-31 Martin Liska <mliska@suse.cz>
+ * gcc.dg/builtin-unreachable-6.c: Update scanned patterns.
+ * gcc.dg/tree-ssa/attr-hotcold-2.c: Likewise.
+
+2017-07-31 Martin Liska <mliska@suse.cz>
+
PR sanitize/81530
* g++.dg/ubsan/pr81530.C: New test.
diff --git a/gcc/testsuite/gcc.dg/builtin-unreachable-6.c b/gcc/testsuite/gcc.dg/builtin-unreachable-6.c
index d2596e95c3f..2f8ca369546 100644
--- a/gcc/testsuite/gcc.dg/builtin-unreachable-6.c
+++ b/gcc/testsuite/gcc.dg/builtin-unreachable-6.c
@@ -16,5 +16,5 @@ lab2:
goto *x;
}
-/* { dg-final { scan-tree-dump-times "lab \\\[\[0-9.\]+%\\\]" 1 "fab1" } } */
+/* { dg-final { scan-tree-dump-times "lab:" 1 "fab1" } } */
/* { dg-final { scan-tree-dump-times "__builtin_unreachable" 1 "fab1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
index 184dd10ddae..5f7e3afa2ae 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
@@ -20,9 +20,9 @@ void f(int x, int y)
/* { dg-final { scan-tree-dump-times "hot label heuristics" 1 "profile_estimate" } } */
/* { dg-final { scan-tree-dump-times "cold label heuristics" 1 "profile_estimate" } } */
-/* { dg-final { scan-tree-dump "A \\\[0\\\..*\\\]" "profile_estimate" } } */
+/* { dg-final { scan-tree-dump-times "combined heuristics: 0\\\..*" 1 "profile_estimate" } } */
/* Note: we're attempting to match some number > 6000, i.e. > 60%.
The exact number ought to be tweekable without having to juggle
the testcase around too much. */
-/* { dg-final { scan-tree-dump "B \\\[\[6-9\]\[0-9\]\\\..*\\\]" "profile_estimate" } } */
+/* { dg-final { scan-tree-dump-times "combined heuristics: \[6-9\]\[0-9\]\\\..*" 1 "profile_estimate" } } */