On Mon, May 07, 2007 at 09:35:38PM +0200, Eric Botcazou wrote:
> >    It isn't until the loop2_done dump that the problem shows up.
> > delete_trivially_dead_insns() is called. It calls dead_libcall_p() on insn
> > 62 and seeing both the REQ_EQUAL and the REG_RETVAL note and successfully
> > replacing reg 92 with const_int 0, determines that the while libcall
> > sequence 63-152-61-62 is dead and can be deleted, without ever checking
> > insns 63, 152 or 61 for liveness.
> 
> Because it's the semantics of libcall sequences.  My take is that the lower 
> subreg pass breaks it in this case.


Here's what it looks like in the jump dump, right before the lower subreg
pass:

(insn 60 56 58 3 memcmp.c:81 (clobber (reg:SI 74)) -1 (nil)
    (nil))

(insn 58 60 59 3 memcmp.c:81 (set (subreg:HI (reg:SI 74) 0)
        (const_int 3 [0x3])) 23 {*movhi} (nil)
    (nil))

(insn 59 58 63 3 memcmp.c:81 (set (subreg:HI (reg:SI 74) 2)
        (const_int 0 [0x0])) 23 {*movhi} (nil)
    (nil))

(insn 63 59 61 3 memcmp.c:81 (clobber (reg:SI 75)) -1 (nil)
    (insn_list:REG_LIBCALL 62 (nil)))

(insn 61 63 62 3 memcmp.c:81 (parallel [
            (set (subreg:HI (reg:SI 75) 0)
                (and:HI (subreg:HI (reg:SI 73) 0)
                    (subreg:HI (reg:SI 74) 0)))
            (clobber (reg:CC 13 cc))
        ]) 120 {*andhi3} (nil)
    (expr_list:REG_NO_CONFLICT (reg:SI 73)
        (expr_list:REG_NO_CONFLICT (reg:SI 74)
            (nil))))

(insn 62 61 64 3 memcmp.c:81 (parallel [
            (set (subreg:HI (reg:SI 75) 2)
                (and:HI (subreg:HI (reg:SI 73) 2)
                    (subreg:HI (reg:SI 74) 2)))
            (clobber (reg:CC 13 cc))
        ]) 120 {*andhi3} (nil)
    (insn_list:REG_RETVAL 63 (expr_list:REG_NO_CONFLICT (reg:SI 73)
            (expr_list:REG_NO_CONFLICT (reg:SI 74)
                (nil)))))

(insn 64 62 65 3 memcmp.c:81 (set (reg:HI 76)
        (subreg:HI (reg:SI 75) 0)) 23 {*movhi} (nil)
    (nil))

(insn 65 64 66 3 memcmp.c:81 (parallel [
            (set (reg:HI 76)
                (ior:HI (reg:HI 76)
                    (subreg:HI (reg:SI 75) 2)))
            (clobber (reg:CC 13 cc))
        ]) 122 {*iorhi3} (nil)
    (nil))

(insn 66 65 67 3 memcmp.c:81 (set (reg:CC 13 cc)
        (compare:CC (reg:HI 76)
            (const_int 0 [0x0]))) 481 {*cmphi_const0_cc} (nil)
    (nil))

(jump_insn 67 66 68 3 memcmp.c:81 (set (pc)
        (if_then_else (ne (reg:CC 13 cc)
                (const_int 0 [0x0]))
            (label_ref 93)
            (pc))) 561 {*bne_cc} (nil)
    (expr_list:REG_BR_PROB (const_int 5000 [0x1388])
        (nil)))

-- 
Rask Ingemann Lambertsen

Reply via email to