On Wed, Apr 15, 2015 at 11:05 AM, Steven Bosscher <stevenb....@gmail.com> wrote: > On Wed, Apr 15, 2015 at 9:53 AM, Kugan wrote: >> 2015-04-15 Kugan Vivekanandarajah < > >> Zhenqiang Chen <> >> >> PR target/65768 >> * cprop.c (try_replace_reg): Check cost of constants before >> propagating. > > >> + >> + /* For CONSTANT_P (to), loop2_invariant pass might hoist it out the loop. >> + And it can be shared by different references. So skip propagation if >> + it makes INSN's rtx cost higher. */ >> + > > So only undo if the insn is inside a loop (i.e. > BLOCK_FOR_INSN(insn)->loop_father != NULL) and this is a > post-pass_loop2 cprop run?
post loop2 loops are destroyed. When loops are available loop_father is always non-NULL, the proper check is for loop_outer (->loop_father) == NULL. or loop_depth (->loop_father) != 0. Richard. > > Ciao! > Steven