Hello all,

For a target that i porting in gcc 4.1.2 i am getting the following
assert failure :

internal compiler error: in schedule_region, at sched-rgn.c:2413

This is due to the  following line
gcc_assert (sched_rgn_n_insns == rgn_n_insns);

I executed the program with -O2 option. When -fno-schedule-insn2 or
-fno-reorder-block is provided the program works fine.
The code that i am using for testing has 3 basic blocks. Block reorder
phase makes changes to produce the following as
the last basic block


;; Start of basic block 2, registers live: 7 [R7] 12 [R12]
(code_label 104 100 43 2 6 "" [1 uses])

(note 43 104 47 2 [bb 2] NOTE_INSN_BASIC_BLOCK)

(call_insn 47 43 105 2 (parallel [
            (call (mem:HI (symbol_ref:HI ("fun2") [flags 0x41]
<function_decl 0xb7d33780 fun2>) [0 S2 A16])
                (const_int 0 [0x0]))
            (use (reg:HI 7 R7 [28]))
        ]) 20 {*call_internal} (insn_list:REG_DEP_ANTI 41
(insn_list:REG_DEP_OUTPUT 37 (insn_list:REG_DEP_TRUE 17
(insn_list:REG_DEP_TRUE 16 (insn_list:REG_DEP_ANTI 39 (nil))))))
    (nil)
    (nil))

(jump_insn 105 47 106 2 (set (pc)
        (label_ref 48)) -1 (nil)
    (nil))

(barrier 106 105 107)
;; End of basic block 2, registers live:
 7 [R7] 12 [R12]

This looks like reordering is proper. When schedule-insn2 is run for
the above region/block the no:of instructions in the region
(rgn_n_insns) is 3.
Initially call insn gets scheduled and then unconditional jump
instruction gets scheduled (hence sched_n_insns becomes 2). But since
the last scheduled instruction is a jump instruction scheduling stops
and comes out. Due to this the assertion fails. Looking at the code i
am not able to find out where
the problem might be. Can anyone help me?

Thanks for your time.

Regards,
Shafi.

Reply via email to