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



--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> 2012-11-04 
12:49:27 UTC ---

I think the problem is that we somehow arrive at this:

  loop_1 (header = 2, multiple latches, niter = )

  {

    bb_2 (preds = {bb_0 }, succs = {bb_4 bb_3 })

    {

(note 5 0 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)

(insn 2 5 3 2 (set (reg/v/f:DI 60 [ b ])

        (reg:DI 5 di [ b ])) ./pr54838.c:5 63 {*movdi_internal_rex64}

     (nil))

(insn 3 2 4 2 (set (reg/v/f:DI 61 [ c ])

        (reg:DI 4 si [ c ])) ./pr54838.c:5 63 {*movdi_internal_rex64}

     (nil))

(note 4 3 7 2 NOTE_INSN_FUNCTION_BEG)

(insn 7 4 14 2 (set (reg:SI 59 [ D.1735 ])

        (mem:SI (reg/v/f:DI 61 [ c ]) [2 *c_3(D)+0 S4 A32])) 65

{*movsi_internal}

     (nil))

(insn 14 7 15 2 (set (reg:CCZ 17 flags)

        (compare:CCZ (reg:SI 59 [ D.1735 ])

            (const_int 1 [0x1]))) ./pr54838.c:7 7 {*cmpsi_1}

     (nil))

(jump_insn 15 14 38 2 (set (pc)

        (if_then_else (eq (reg:CCZ 17 flags)

                (const_int 0 [0]))

            (label_ref:DI 20)

            (pc))) ./pr54838.c:7 595 {*jcc_1}

     (expr_list:REG_BR_PROB (const_int 3333 [0xd05])

        (nil))

 -> 20)



    }

  }

, i.e. we have a loop which contains only the header.  The rest of BBs are

there, but in loop_0.  When we call disambiguate_loops_with_multiple_latches,

loop->latch is NULL on that loop, so we end up calling merge_latch_edges, but

that ICEs because VEC_length (edge, latches) is of course 0.

Reply via email to