Commit 33627377 by Kewen Lin

Add hint if the fallthrough target of current BB isn't the one

placed closely next.

2019-07-12  Kewen Lin  <linkw@gcc.gnu.org>

    * gcc/cfgrtl.c (print_rtl_with_bb): Emit a hint if the
    fallthrough target of current basic block isn't the placed
    right next.

From-SVN: r273430
parent e63f8349
2019-07-12 Kewen Lin <linkw@gcc.gnu.org>
* gcc/cfgrtl.c (print_rtl_with_bb): Emit a hint if the
fallthrough target of current basic block isn't the placed
right next.
2019-07-11 Sunil K Pandey <sunil.k.pandey@intel.com> 2019-07-11 Sunil K Pandey <sunil.k.pandey@intel.com>
PR target/90980 PR target/90980
......
...@@ -2198,7 +2198,7 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags) ...@@ -2198,7 +2198,7 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags)
if (df) if (df)
df_dump_start (outf); df_dump_start (outf);
if (flags & TDF_BLOCKS) if (cfun->curr_properties & PROP_cfg)
{ {
FOR_EACH_BB_REVERSE_FN (bb, cfun) FOR_EACH_BB_REVERSE_FN (bb, cfun)
{ {
...@@ -2206,6 +2206,8 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags) ...@@ -2206,6 +2206,8 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags)
start[INSN_UID (BB_HEAD (bb))] = bb; start[INSN_UID (BB_HEAD (bb))] = bb;
end[INSN_UID (BB_END (bb))] = bb; end[INSN_UID (BB_END (bb))] = bb;
if (flags & TDF_BLOCKS)
{
for (x = BB_HEAD (bb); x != NULL_RTX; x = NEXT_INSN (x)) for (x = BB_HEAD (bb); x != NULL_RTX; x = NEXT_INSN (x))
{ {
enum bb_state state = IN_MULTIPLE_BB; enum bb_state state = IN_MULTIPLE_BB;
...@@ -2219,6 +2221,7 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags) ...@@ -2219,6 +2221,7 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags)
} }
} }
} }
}
for (tmp_rtx = rtx_first; tmp_rtx != NULL; tmp_rtx = NEXT_INSN (tmp_rtx)) for (tmp_rtx = rtx_first; tmp_rtx != NULL; tmp_rtx = NEXT_INSN (tmp_rtx))
{ {
...@@ -2249,16 +2252,36 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags) ...@@ -2249,16 +2252,36 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags)
if (flags & TDF_DETAILS) if (flags & TDF_DETAILS)
df_dump_insn_bottom (tmp_rtx, outf); df_dump_insn_bottom (tmp_rtx, outf);
if (flags & TDF_BLOCKS)
{
bb = end[INSN_UID (tmp_rtx)]; bb = end[INSN_UID (tmp_rtx)];
if (bb != NULL) if (bb != NULL)
{ {
if (flags & TDF_BLOCKS)
{
dump_bb_info (outf, bb, 0, dump_flags, false, true); dump_bb_info (outf, bb, 0, dump_flags, false, true);
if (df && (flags & TDF_DETAILS)) if (df && (flags & TDF_DETAILS))
df_dump_bottom (bb, outf); df_dump_bottom (bb, outf);
putc ('\n', outf); putc ('\n', outf);
} }
/* Emit a hint if the fallthrough target of current basic block
isn't the one placed right next. */
else if (EDGE_COUNT (bb->succs) > 0)
{
gcc_assert (BB_END (bb) == tmp_rtx);
const rtx_insn *ninsn = NEXT_INSN (tmp_rtx);
/* Bypass intervening deleted-insn notes and debug insns. */
while (ninsn
&& !NONDEBUG_INSN_P (ninsn)
&& !start[INSN_UID (ninsn)])
ninsn = NEXT_INSN (ninsn);
edge e = find_fallthru_edge (bb->succs);
if (e && ninsn)
{
basic_block dest = e->dest;
if (start[INSN_UID (ninsn)] != dest)
fprintf (outf, "%s ; pc falls through to BB %d\n",
print_rtx_head, dest->index);
}
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment