diff options
author | Yiran Wang <yiran@google.com> | 2015-06-23 15:33:17 -0700 |
---|---|---|
committer | Yiran Wang <yiran@google.com> | 2015-06-29 10:56:28 -0700 |
commit | 1d9fec7937f45dde5e04cac966a2d9a12f2fc15a (patch) | |
tree | 3fbcd18a379a05fd6d43491a107e1f36bc61b185 /gcc-4.9/gcc/cfgrtl.c | |
parent | f378ebf14df0952eae870c9865bab8326aa8f137 (diff) | |
download | toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.zip toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.gz toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.bz2 |
Synchronize with google/gcc-4_9 to r224707 (from r214835)
Change-Id: I3d6f06fc613c8f8b6a82143dc44b7338483aac5d
Diffstat (limited to 'gcc-4.9/gcc/cfgrtl.c')
-rw-r--r-- | gcc-4.9/gcc/cfgrtl.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/gcc-4.9/gcc/cfgrtl.c b/gcc-4.9/gcc/cfgrtl.c index 2c5ca2a..ed1c37c 100644 --- a/gcc-4.9/gcc/cfgrtl.c +++ b/gcc-4.9/gcc/cfgrtl.c @@ -1453,7 +1453,24 @@ emit_barrier_after_bb (basic_block bb) gcc_assert (current_ir_type () == IR_RTL_CFGRTL || current_ir_type () == IR_RTL_CFGLAYOUT); if (current_ir_type () == IR_RTL_CFGLAYOUT) - BB_FOOTER (bb) = unlink_insn_chain (barrier, barrier); + { + rtx insn = unlink_insn_chain (barrier, barrier); + + if (BB_FOOTER (bb)) + { + rtx footer_tail = BB_FOOTER (bb); + + while (NEXT_INSN (footer_tail)) + footer_tail = NEXT_INSN (footer_tail); + if (!BARRIER_P (footer_tail)) + { + NEXT_INSN (footer_tail) = insn; + PREV_INSN (insn) = footer_tail; + } + } + else + BB_FOOTER (bb) = insn; + } } /* Like force_nonfallthru below, but additionally performs redirection @@ -1761,6 +1778,22 @@ rtl_tidy_fallthru_edge (edge e) && (any_uncondjump_p (q) || single_succ_p (b))) { + rtx label, table; + + if (tablejump_p (q, &label, &table)) + { + /* The label is likely mentioned in some instruction before + the tablejump and might not be DCEd, so turn it into + a note instead and move before the tablejump that is going to + be deleted. */ + const char *name = LABEL_NAME (label); + PUT_CODE (label, NOTE); + NOTE_KIND (label) = NOTE_INSN_DELETED_LABEL; + NOTE_DELETED_LABEL_NAME (label) = name; + reorder_insns (label, label, PREV_INSN (q)); + delete_insn (table); + } + #ifdef HAVE_cc0 /* If this was a conditional jump, we need to also delete the insn that set cc0. */ @@ -2481,7 +2514,6 @@ rtl_verify_edges (void) | EDGE_LOOP_EXIT | EDGE_CROSSING | EDGE_PRESERVE - | EDGE_ANNOTATED | EDGE_PREDICTED_BY_EXPECT)) == 0) n_branch++; |