aboutsummaryrefslogtreecommitdiff
path: root/gcc/sel-sched-ir.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-09-06 07:29:12 +0000
committerJakub Jelinek <jakub@redhat.com>2012-09-06 07:29:12 +0000
commite5a108a4bc878abbe15427cb570bbc4189c48b37 (patch)
treef8d040452ec5242138c3043b9a7cc3be15f871d4 /gcc/sel-sched-ir.c
parent61d50e330007c71cac09327c2f99ad77fdf46610 (diff)
PR rtl-optimization/54455
* sel-sched-ir.c (maybe_tidy_empty_bb): Give up if previous fallthru bb ends up with asm goto referencing bb's label. * gcc.dg/54455.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@191013 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sel-sched-ir.c')
-rw-r--r--gcc/sel-sched-ir.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 449efc97cbc..1f1095ecfed 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -1,5 +1,5 @@
/* Instruction scheduling pass. Selective scheduler and pipeliner.
- Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
+ Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
@@ -3686,6 +3686,22 @@ maybe_tidy_empty_bb (basic_block bb)
FOR_EACH_EDGE (e, ei, bb->preds)
if (e->flags & EDGE_COMPLEX)
return false;
+ else if (e->flags & EDGE_FALLTHRU)
+ {
+ rtx note;
+ /* If prev bb ends with asm goto, see if any of the
+ ASM_OPERANDS_LABELs don't point to the fallthru
+ label. Do not attempt to redirect it in that case. */
+ if (JUMP_P (BB_END (e->src))
+ && (note = extract_asm_operands (PATTERN (BB_END (e->src)))))
+ {
+ int i, n = ASM_OPERANDS_LABEL_LENGTH (note);
+
+ for (i = 0; i < n; ++i)
+ if (XEXP (ASM_OPERANDS_LABEL (note, i), 0) == BB_HEAD (bb))
+ return false;
+ }
+ }
free_data_sets (bb);