http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-09 
17:48:04 UTC ---
The problem is when processing
(insn:TI 75 270 251 5 (cond_exec (eq (reg:BI 262 p6 [394])
            (const_int 0 [0]))
        (set (mem/c/i:SI (reg/f:DI 32 r33 [409]) [2 x+0 S4 A64])
            (const_int 0 [0]))) pr46387.c:22 813 {*p movsi_internal}
     (nil))
we don't invalidate the old mem content.  cselib_invalidate_mem is called with
mem_rtx:
(mem/c/i:SI (reg/f:DI 32 r33 [409]) [2 x+0 S4 A64])
and we see x:
(mem/c/i:SI (value/u:DI 23:3920 @0x16199f0/0x1623ec0) [2 x+0 S4 A64])
But
canon_true_dependence (mem_rtx, GET_MODE (mem_rtx), mem_addr, x, NULL_RTX,
cselib_rtx_varies_p)
returns 0, which means it is not invalidated.
debug_rtx (((cselib_val *)0x1623ec0)->locs->loc) shows:
(reg/f:DI 32 r33 [409])
debug_rtx (((cselib_val *)0x1623ec0)->locs->next->loc) shows:
(plus:DI (value/u:DI 1:1 @0x16197e0/0x166c490)
    (const_int -8 [0xfffffffffffffff8]))
and that is the whole list.  VALUE 1:1 has only one living location:
(reg/f:DI 0 ap)

find_base_term of r33 gives r12 as base though (as init_alias_analysis has been
run before vt_initialize and doesn't know about the munging vt_initialize
performs to replace sp or hfp (+ offset) with cfa_base_rtx (which is either
argp or fp).

I guess we want to (temporarily, for the rest of var-tracking) set
REG_BASE_VALUE (cfa_base_rtx) to REG_BASE_VALUE (frame_pointer_needed ?
hard_frame_pointer_rtx : stack_pointer_rtx).

Reply via email to