------- Comment #37 from steven at gcc dot gnu dot org  2006-01-13 23:26 -------
I think I know what the problem is.  At the point where we error in cfgrtl, we
have the following basic block:

Breakpoint 3, rtl_verify_flow_info_1 () at cfgrtl.c:2051
2051              error ("wrong amount of branch edges after conditional jump
%i", bb->index);
(gdb) l
2046              err = 1;
2047            }
2048          if (n_branch != 1 && any_condjump_p (BB_END (bb))
2049              && JUMP_LABEL (BB_END (bb)) != BB_HEAD (fallthru->dest))
2050            {
2051              error ("wrong amount of branch edges after conditional jump
%i", bb->index);
2052              err = 1;
2053            }
2054          if (n_call && !CALL_P (BB_END (bb)))
2055            {
(gdb) p debug_bb(bb)
;; basic block 7, loop depth 0, count 0
;; prev block 1, next block 9
;; pred:       1 [100.0%]  (fallthru)
;; succ:       9 [100.0%]  (fallthru) 8 (true)
;; Registers live at start:  1 [1] 31 [31] 67 [ap] 113 [sfp] 123 127 128 129
139
(note 89 68 90 7 [bb 7] NOTE_INSN_BASIC_BLOCK)
(insn 90 89 91 7 (set (reg:CC 140)
        (compare:CC (reg:SI 139)
            (const_int 1 [0x1]))) -1 (nil)
    (nil))
(jump_insn 91 90 94 7 (set (pc)
        (if_then_else (gt (reg:CC 140)
                (const_int 0 [0x0]))
            (label_ref:SI 93)
            (pc))) 472 {*rs6000.md:12875} (nil)
    (nil))
;; Registers live at end:  1 [1] 31 [31] 67 [ap] 113 [sfp] 123 127 128 129 139


Note the "(true)" flag on the edge to block 8.  That is the EDGE_TRUE_VALUE
flag, which is not supposed to appear on trees.  We fail to compute n_branch
properly because of this:

          if ((e->flags & ~(EDGE_DFS_BACK
                            | EDGE_CAN_FALLTHRU
                            | EDGE_IRREDUCIBLE_LOOP
                            | EDGE_LOOP_EXIT
                            | EDGE_CROSSING)) == 0)
            n_branch++;

Aha, but we have (e->flags & ~(EDGE_DFS_BACK
                            | EDGE_CAN_FALLTHRU
                            | EDGE_IRREDUCIBLE_LOOP
                            | EDGE_LOOP_EXIT
                            | EDGE_CROSSING)) == EDGE_TRUE_VALUE)
so n_branch stays at 0.  Then we go on checking with the wrong n_branch, and we
get to the point where we fail.

My best bet: loop versioning still has bits that assume it works on trees only.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24626

Reply via email to