http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57763
--- Comment #7 from Steven Bosscher <steven at gcc dot gnu.org> ---
find_many_sub_basic_blocks calls make_edges. Things go bad from there.
A block ending in an indirect_jump is marked for find_many_sub_bbs (but
actually the basic block boundaries are not changed) and gets passed
to make_edges (with min==max==bb). The bb looks like this:
basic block 33, loop depth 0, count 0, freq 0, probably never executed
Invalid sum of outgoing probabilities 0.0%
Invalid sum of incoming frequencies 199, should be 0
prev block 32, next block 1, flags: (NEW, REACHABLE, COLD_PARTITION, RTL,
MODIFIED)
pred: 26 [25.0%]
;; bb 33 artificial_defs: { }
;; bb 33 artificial_uses: { u-1(30){ }}
;; lr in 1 [$1] 2 [$2] 3 [$3] 5 [$5] 26 [$26] 29 [$29] 30 [$30]
;; lr use 30 [$30]
;; lr def 4 [$4]
;; live in 1 [$1] 2 [$2] 3 [$3] 5 [$5] 26 [$26] 30 [$30]
;; live gen 4 [$4]
;; live kill
395: L395:
397: NOTE_INSN_BASIC_BLOCK 33
478: $4:DI=$29:DI+high(L54)
REG_EQUAL high(L54)
436: $4:DI=$4:DI+low(L54)
REG_EQUIV L54
REG_LABEL_OPERAND code_label
437: pc=$4:DI
REG_CROSSING_JUMP (nil)
;; lr out 1 [$1] 2 [$2] 3 [$3] 5 [$5] 26 [$26] 29 [$29] 30 [$30]
;; live out 1 [$1] 2 [$2] 3 [$3] 5 [$5] 26 [$26] 30 [$30]
succ: 11 (CROSSING)
22 (ABNORMAL)
With this we go to make_edges, which does:
/* If this is a computed jump, then mark it as reaching
everything on the forced_labels list. */
else if (computed_jump_p (insn))
{
for (x = forced_labels; x; x = XEXP (x, 1))
make_label_edge (edge_cache, bb, XEXP (x, 0), EDGE_ABNORMAL);
}
The first forced_label in the list is the head of basic block 12.
There is no edge 33->12 so we create one. Without the right flags...
(Why that edge is not there to begin with, I don't know, but I suspect that
the block's outgoing edges were simply carried over from GIMPLE and never
needed updating...)