aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-12-12 21:00:36 +0000
committerJakub Jelinek <jakub@redhat.com>2011-12-12 21:00:36 +0000
commit0d02ab9c3f05a3a6174a84e7ecf4affcebc42f4a (patch)
tree7ed652648dc198102247414a0ec9f76f20b4e4d9 /gcc/function.c
parent9bb5b3fcbe69eed965017f76699192c98c2202f0 (diff)
PR rtl-optimization/51495
* function.c (thread_prologue_and_epilogue_insns): Don't add to bb_tail basic blocks that have EDGE_COMPLEX predecessor edges from basic blocks not needing prologue. * gcc.c-torture/compile/pr51495.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@182265 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/function.c b/gcc/function.c
index a081b270ec0..506ec030745 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -5956,9 +5956,22 @@ thread_prologue_and_epilogue_insns (void)
FOR_EACH_EDGE (e, ei, tmp_bb->preds)
if (single_succ_p (e->src)
&& !bitmap_bit_p (&bb_on_list, e->src->index)
- && can_duplicate_block_p (e->src)
- && bitmap_set_bit (&bb_tail, e->src->index))
- VEC_quick_push (basic_block, vec, e->src);
+ && can_duplicate_block_p (e->src))
+ {
+ edge pe;
+ edge_iterator pei;
+
+ /* If there is predecessor of e->src which doesn't
+ need prologue and the edge is complex,
+ we might not be able to redirect the branch
+ to a copy of e->src. */
+ FOR_EACH_EDGE (pe, pei, e->src->preds)
+ if ((pe->flags & EDGE_COMPLEX) != 0
+ && !bitmap_bit_p (&bb_flags, pe->src->index))
+ break;
+ if (pe == NULL && bitmap_set_bit (&bb_tail, e->src->index))
+ VEC_quick_push (basic_block, vec, e->src);
+ }
}
/* Now walk backwards from every block that is marked as needing