980729-1.c:14: Virtual array basic_block_for_insn[82]: element 86 out of bounds in merge_blocks_nomove, at flow.c:2887

apl@alum.mit.edu apl@alum.mit.edu
Mon Jul 30 07:20:00 GMT 2001


I synced up as of early afternoon today 7/29/01, and see a large
number (70 maybe?) testsuite failures due to the varray overflowing its bounds.
It seems improbable that my port is the only one that would hit these
things.

Jan, have you been just bootstrapping the compiler, or have you been
running the c-torture testsuite also?

It appears that in this case, we have grown the varray to 82 elements
before reload.  Reload allocates a bunch of new INSNS (not too
surprising) and then when we call cleanup_cfg(), it tries to find the
basic block associated with INSN 86 when surprise!!  We haven't grown
the basic_block_for_insn array and won't until after cleanup_cfg ()
finishes....

Here's the code in toplev

  cleanup_cfg (0);

  /* On some machines, the prologue and epilogue code, or parts thereof,
     can be represented as RTL.  Doing so lets us schedule insns between
     it and the rest of the code and also allows delayed branch
     scheduling to operate in the epilogue.  */
  thread_prologue_and_epilogue_insns (insns);

  compute_bb_for_insn (get_max_uid ());

And the RTL in the postreload dump....


;; Function regex_compile

(note 2 0 3 NOTE_INSN_DELETED)

(note 3 2 5 NOTE_INSN_FUNCTION_BEG)

(note 5 3 61 4cd5c0 NOTE_INSN_BLOCK_BEG)

;; Start of basic block 0, registers live: 0 [r0] 19 [sp] 28
(note 61 5 11 [bb 0] NOTE_INSN_BASIC_BLOCK)

(insn 11 61 71 (set (reg/v:QI 1 r1 [29])
        (const_int 0 [0x0])) 11 {*movqi} (nil)
    (nil))

(note 71 11 72 NOTE_INSN_DELETED)

(note 72 71 79 NOTE_INSN_DELETED)
;; End of basic block 0, registers live:
 0 [r0] 14 [r14] 19 [sp] 20 [*vfp] 21 [*ap] 28 29

;; Start of basic block 1, registers live: 0 [r0] 19 [sp] 28 29
(note 79 72 80 [bb 1] NOTE_INSN_BASIC_BLOCK)

(insn 80 79 86 (set (reg/f:QI 2 r2 [31])
        (const_int 7 [0x7])) 11 {*movqi} (nil)
    (nil))

(insn 86 80 88 (set (reg:QI 4 r4)
        (const_int 7 [0x7])) 11 {*movqi} (nil)
    (nil))

(insn 88 86 81 (set (reg:QI 4 r4)
        (plus:QI (reg:QI 4 r4)
            (reg/f:QI 19 sp))) 14 {*tpc.md:754} (nil)
    (expr_list:REG_EQUIV (plus:QI (reg/f:QI 19 sp)
            (const_int 7 [0x7]))
        (nil)))

(insn 81 88 13 (set (reg/f:QI 2 r2 [31])
        (minus:QI (reg:QI 4 r4)
            (reg/f:QI 2 r2 [31]))) 30 {*tpc.md:1147} (nil)
    (nil))
;; End of basic block 1, registers live:
 0 [r0] 14 [r14] 19 [sp] 20 [*vfp] 21 [*ap] 28 29 31

(note 13 81 25 NOTE_INSN_LOOP_BEG)

;; Start of basic block 2, registers live: 0 [r0] 19 [sp] 28 29 31
(code_label 25 13 63 6 "" "" [2 uses])

(note 63 25 38 [bb 2] NOTE_INSN_BASIC_BLOCK)

(insn 38 63 40 (set (reg/f:QI 17 ptr1 [34])
        (plus:QI (reg/f:QI 2 r2 [31])
            (reg/v:QI 1 r1 [29]))) 14 {*tpc.md:754} (nil)
    (nil))

(insn 40 38 41 (set (mem/s:QI (reg/f:QI 17 ptr1 [34]) 0)
        (reg/v:QI 3 r3 [28])) 11 {*movqi} (insn_list 38 (nil))
    (nil))

(insn 41 40 43 (set (reg/v:QI 1 r1 [29])
        (plus:QI (reg/v:QI 1 r1 [29])
            (const_int 1 [0x1]))) 14 {*tpc.md:754} (nil)
    (nil))

(note 43 41 76 NOTE_INSN_LOOP_CONT)

(note 76 43 20 NOTE_INSN_LOOP_VTOP)

(insn 20 76 21 (set (cc0)
        (compare (reg/v:QI 1 r1 [29])
            (const_int 6 [0x6]))) 50 {cmpqi} (insn_list 41 (nil))
    (nil))

(jump_insn 21 20 50 (set (pc)
        (if_then_else (ne (cc0)
                (const_int 0 [0x0]))
            (label_ref 25)
            (pc))) 52 {*condjump} (nil)
    (expr_list:REG_BR_PROB (const_int 9830 [0x2666])
        (nil)))
;; End of basic block 2, registers live:
 0 [r0] 14 [r14] 19 [sp] 20 [*vfp] 21 [*ap] 28 29 31

(note 50 21 73 NOTE_INSN_LOOP_END)

;; Start of basic block 3, registers live: 0 [r0] 19 [sp]
(code_label 73 50 69 8 "" "" [1 uses])

(note 69 73 52 [bb 3] NOTE_INSN_BASIC_BLOCK)

(note 52 69 53 4cd5c0 NOTE_INSN_BLOCK_END)

(note 53 52 58 NOTE_INSN_FUNCTION_END)

(insn 58 53 59 (clobber (reg/i:QI 1 r1)) -1 (nil)
    (nil))

(note 59 58 57 NOTE_INSN_DELETED)

(insn 57 59 60 (use (reg/i:QI 1 r1)) -1 (insn_list 59 (nil))
    (nil))

(insn 60 57 82 (use (reg/i:QI 1 r1)) -1 (insn_list 57 (nil))
    (nil))
;; End of basic block 3, registers live:
 0 [r0] 1 [r1] 14 [r14] 19 [sp] 20 [*vfp] 21 [*ap]

(note 82 60 0 NOTE_INSN_DELETED)



More information about the Gcc-bugs mailing list