[PATCH] Re: reg_dead_notes!=0: New abort in haifa scheduler in latest CVS

Jim Wilson wilson@cygnus.com
Mon May 11 16:15:00 GMT 1998


I've taken an initial look at this.

The problem is that combine takes the two instructions

(insn/i 15 14 16 (parallel[
            (set (reg/v:SI 86)
                (and:SI (reg/v:SI 81)
                    (const_int 255)))
            (clobber (scratch:CC))
        ] ) 115 {andsi3} (insn_list 4 (nil))
    (expr_list:REG_UNUSED (scratch:CC)
        (nil)))

(insn 25 23 27 (set (reg:SI 3 r3)
        (ior:SI (reg:SI 87)
            (reg/v:SI 86))) 119 {*iorsi3_internal1} (insn_list 16 (insn_list 15 (nil)))
    (expr_list:REG_DEAD (reg/v:SI 86)
        (expr_list:REG_DEAD (reg:SI 87)
            (nil))))

and combines them to get 

(insn 25 23 27 (set (zero_extract:SI (reg:SI 3 r3)
            (const_int 24)
            (const_int 0))
        (lshiftrt:SI (reg:SI 87)
            (const_int 8))) 153 {extzv-3} (insn_list 16 (nil))
    (expr_list:REG_DEAD (reg:SI 87)
        (nil)))

Note that reg 81 has disappeared.  This is because combine used some outside
info (get_last_value) to determine that reg 81 and reg 3 held the same value.
Unfortunately, the code that handles REG_DEAD notes looks only at the RTL,
and does not know that this outside info was used.  There is no way to
determine what happened after the fact only by looking at the combined RTL, and
hence we don't know that the lifetime of r3 was extended from before insn 15
to the combined result.

I don't see any obvious way to fix this.  I suspect we need some special
purpose code to handle this case, computing some info before we do the
combination, and then checking the result to see if it uses registers that
weren't used by the input RTL.  This will take me some time to work out.

Jim









More information about the Gcc-bugs mailing list