summaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorRong Xu <xur@gcc.gnu.org>2014-11-14 00:30:31 +0000
committerRong Xu <xur@gcc.gnu.org>2014-11-14 00:30:31 +0000
commit0fb3402f691447225a17f83d1ef168eb71a25ce0 (patch)
treea2d90d71efdd31c74e3e6708927cf8f6f80dd80b /gcc/cfgrtl.c
parent6ff65dd7d59139e120d1dcdb54d5a5bb0d07e2c0 (diff)
downloadgcc-0fb3402f691447225a17f83d1ef168eb71a25ce0.tar.gz
re PR debug/63581 (undefined references in debug_info)
2014-11-13 Rong Xu <xur@google.com> gcc: PR debug/63581 * cfgrtl.c (emit_barrier_after_bb): Append the barrier to the footer, instead of unconditionally overwritten gcc/testsuite: PR debug/63581 * g++.dg/tree-prof/pr63581.C: New test. From-SVN: r217530
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index f6eb2072d11..42d21d72201 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -1461,7 +1461,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 *insn = unlink_insn_chain (barrier, barrier);
+
+ if (BB_FOOTER (bb))
+ {
+ rtx_insn *footer_tail = BB_FOOTER (bb);
+
+ while (NEXT_INSN (footer_tail))
+ footer_tail = NEXT_INSN (footer_tail);
+ if (!BARRIER_P (footer_tail))
+ {
+ SET_NEXT_INSN (footer_tail) = insn;
+ SET_PREV_INSN (insn) = footer_tail;
+ }
+ }
+ else
+ BB_FOOTER (bb) = insn;
+ }
}
/* Like force_nonfallthru below, but additionally performs redirection