On 11/26/13 15:44, Steven Bosscher wrote:
Open to other suggestions.
Can't claim to have any, at least not for short-term solutions.
How about rtl_merge_blocks getting smarter about removing BARRIERS
between the blocks-to-be-merged?
Something like this (untested, except for verifying it avoids the
problem in the testcase on arm)?
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 63f44af..8f3763c 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -878,8 +878,15 @@ rtl_merge_blocks (basic_block a, basic_block b)
a_end = PREV_INSN (del_first);
}
- else if (BARRIER_P (NEXT_INSN (a_end)))
- del_first = NEXT_INSN (a_end);
+
+ /* If there is a BARRIER between A & B, remove it, this can happen if
+ we if-convert a block with no successors. */
+ rtx end = NEXT_INSN (a_end);
+ while (end && NOTE_P (end))
+ end = NEXT_INSN (end);
+
+ if (BARRIER_P (end))
+ del_first = end;
/* Delete everything marked above as well as crap that might be
hanging out between the two blocks. */
Thoughts?
jeff