This is the mail archive of the gcc@gcc.gnu.org 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]
Other format: [Raw text]

Re: peephole2: dead regs not marked as dead


On 10/22/2010 01:16 PM, Georg Lay wrote:
Then the first insn gets split after reload and before peephole2:

(insn 22 8 23 2 peep2.c:5 (set (reg:SI 15 d15)
         (and:SI (reg:SI 4 d4 [ x ])
             (const_int -98305 [0xfffe7fff]))) 143 {*and3_zeroes.insert.{SI}.ic}
(nil))

(insn 23 22 21 2 peep2.c:5 (set (reg:SI 15 d15)
         (xor:SI (reg:SI 15 d15)
             (reg:SI 4 d4 [ x ]))) 39 {*xorsi3} (nil))

(insn 21 23 10 2 peep2.c:5 (set (reg:SI 4 d4)
         (reg:SI 15 d15)) 2 {*movsi_insn} (nil))

(call_insn/j 10 21 11 2 peep2.c:5 (parallel [
             (set (reg:SI 2 d2)
                 (call (mem:HI (symbol_ref:SI ("f") [flags 0x41]<function_decl
0xb76b3280 f>) [0 S2 A16])
                     (const_int 0 [0x0])))
             (use (const_int 1 [0x1]))
         ]) 92 {call_value_insn} (nil)
     (expr_list:REG_DEP_TRUE (use (reg:SI 4 d4))
         (nil)))
;; End of basic block 2 ->  ( 1)
;; lr  out 	 2 [d2] 26 [SP] 27 [a11]
;; live  out 	 2 [d2] 26 [SP] 27 [a11]
;; Succ edge  EXIT [100.0%]  (ab,sibcall)

(barrier 11 10 20)

D15, is not marked as dead

True. It should have had a REG_DEAD note. Are you using 4.6 (which scans forwards in peephole2 and requires REG_DEAD notes) or 4.5 (which scans backwards)? If the latter, the absence of the note could be a red herring, because 4.5 didn't need REG_DEAD notes so it didn't compute them.


What's your definition of CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, EPILOGUE_USES? Is d15 in any of them?

Paolo


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