[Bug rtl-optimization/28489] [4.2 regression] ICE in move_insn, at haifa-sched.c:1968

mkuvyrkov at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Aug 2 13:44:00 GMT 2006

------- Comment #9 from mkuvyrkov at gcc dot gnu dot org  2006-08-02 13:44 -------
(In reply to comment #8)
> The time that this started occurring looks to be about the time that Maxim was
> making scheduling changes for IA64 speculation.  Maxim could you look at this
> bug and see if it is related to any of your changes to IA64 scheduling?  I did
> a little analysis and it looks like we are merging/concatinated two basic
> blocks (3 and 7) but we wind up with a NOTE_INSN_BASIC_BLOCK for block 7 in the
> middle of the merged basic block 3.

That's my bug, sorry.
In this testcase we hit a rare case when we end up with dead code during

More specifically:
(insn 127 128 108 3 (set (reg:DI 332 ar.lc)
        (reg:DI 35 r35)) 5 {*movdi_internal} (nil)
    (expr_list:REG_DEAD (reg:DI 35 r35)
(call_insn/j 108 127 146 3 (call (mem:DI (symbol_ref:DI ("cr") [flags 0x3]
<function_decl 0x2000000000449500 cr>) [0 S8 A64])
        (const_int 0 [0x0])) 321 {sibcall_nogp} (nil)
    (expr_list:REG_EH_REGION (const_int 0 [0x0])
    (expr_list:REG_DEP_TRUE (use (reg:DI 320 b0))
        (expr_list:REG_DEP_TRUE (use (reg:DI 1 r1))

More specifically, a call (108) - which will exit from the function - is
scheduled before insn (127) thus making it dead.  To schedule the dead insn we
should create an empty basic block right after call.  But I've made a mistake
and current code creates new basic block just before it.

While debugging one of the above testcases I've also discovered another problem
in switching between blocks in the ebb.  While switching to the next block we
should skip empty ones so that jumps won't be moved across blocks when not
particularly needed.

The attached patch works for all testcases and as soon as regtesting is over
I'll post it to gcc-patches list.

> (I tried to add mkuvyrkov@ispras.ru to the CC list but Bugzilla wouldn't do it.

It is because mkuvyrkov@ispras.ru doesn't have a Bugzilla account.
You could've add mkuvyrkov@gcc.gnu.org .

Thanks for the testcases.  It is good to have several testcases as only one of
them revealed the second problem.



mkuvyrkov at gcc dot gnu dot org changed:

           What    |Removed                     |Added
                 CC|                            |mkuvyrkov at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |mkuvyrkov at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-07-29 10:57:44         |2006-08-02 13:44:23
               date|                            |


More information about the Gcc-bugs mailing list