This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bug in propagate_one_insn

As i expected, if a libcall's arguments end up getting set in a block
before the call itself, we end up crashing because propagate_one_insn
returns an insn before the start of the basic block we were
propagating liveness for (and it only terminates if insn == bb->head):

Note, it's not the new register allocator that did
this, it was between regmove and the scheduler that it actually
happened, going by RTL dumps.

RTL causing the actual crash to occur:

(insn 144 148 105 (set (reg:SI 3 r3)
        (reg:SI 155)) 286 {*movsi_internal1} (insn_list:REG_DEP_ANTI 70 (nil))
    (insn_list:REG_LIBCALL 151 (nil)))

<3 other insns>

(note 110 107 129 0x305f0c80 NOTE_INSN_BLOCK_BEG)

(note 129 110 202 0x305f0c80 NOTE_INSN_BLOCK_END)

(note 202 129 149 [bb 6] NOTE_INSN_BASIC_BLOCK)

(call_insn/u 149 202 151 (parallel[ 
            (set (reg:SI 3 r3)
                (call (mem:SI (symbol_ref:SI ("strncmp")) 0)
                    (const_int 0 [0x0])))
            (use (const_int 0 [0x0]))
            (clobber (scratch:SI))
        ] ) 356 {*call_value_nonlocal_sysv} (insn_list:REG_DEP_ANTI 70 (insn_list:REG_DEP_ANTI 107 (insn_list:REG_DEP_ANTI 106 (insn_list:REG_DEP_ANTI 105 (insn_list:REG_DEP_ANTI 89 (insn_list:REG_DEP_ANTI 88 (insn_list:REG_DEP_ANTI 79 (insn_list:REG_DEP_ANTI 78 (insn_list:REG_DEP_ANTI 77 (insn_list:REG_DEP_ANTI 83 (insn_list:REG_DEP_ANTI 84 (insn_list:REG_DEP_ANTI 96 (insn_list:REG_DEP_ANTI 97 (insn_list:REG_DEP_ANTI 98 (insn_list 148 (insn_list 146 (insn_list 144 (nil))))))))))))))))))
    (expr_list:REG_EH_REGION (const_int -1 [0xffffffffffffffff])
    (expr_list (use (mem:BLK (scratch) 0))
        (expr_list (use (reg:SI 5 r5))
            (expr_list (use (reg:SI 4 r4))
                (expr_list (use (reg:SI 3 r3))

(insn/s 151 149 154 (set (reg:SI 169)
        (reg:SI 3 r3)) 286 {*movsi_internal1} (insn_list 144 (insn_list 146 (insn_list 148 (insn_list:REG_DEP_ANTI 98 (insn_list:REG_DEP_ANTI 97 (insn_list:REG_DEP_ANTI 96 (insn_list:REG_DEP_ANTI 84 (insn_list:REG_DEP_ANTI 83 (insn_list:REG_DEP_ANTI 77 (insn_list:REG_DEP_ANTI 78 (insn_list:REG_DEP_ANTI 79 (insn_list:REG_DEP_ANTI 88 (insn_list:REG_DEP_ANTI 89 (insn_list:REG_DEP_ANTI 105 (insn_list:REG_DEP_ANTI 106 (insn_list:REG_DEP_ANTI 107 (insn_list:REG_DEP_ANTI 70 (nil))))))))))))))))))
    (insn_list:REG_RETVAL 144 (expr_list:REG_EQUAL (expr_list (use (mem:BLK (scratch) 0))
                (expr_list (symbol_ref:SI ("strncmp"))
                    (expr_list (reg:SI 103)
                        (expr_list (mem/s/u:SI (plus:SI (reg/f:SI 92)
                                    (reg:SI 146)) 4)
                            (expr_list (reg/f:SI 133)

Anyone have any suggestions how to fix this?
We are trying to avoid having propagate_one_insn scan the argument
setup for the libcall, since we think the libcall is dead, so we jump
from the retval back to the arguments, but since they are in a
previous bb, we never terminate the propagating loop, since it's
looking for the bb head.

"The other night I came home late, and tried to unlock my house
with my car keys.  I started the house up.  So, I drove it
around for a while.  I was speeding, and a cop pulled me over.
He asked where I lived.  I said, "right here, officer".  Later,
I parked it on the freeway, got out, and yelled at all the cars,
"Get out of my driveway!"
"-Steven Wright

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]