On Thu, May 22, 2008 at 12:06 AM, Steven Bosscher <[EMAIL PROTECTED]> wrote: > On Wed, May 21, 2008 at 11:41 PM, Steven Bosscher <[EMAIL PROTECTED]> wrote: >> Maybe that should be emit_move_insn()? > > OK, so that is not it. > > The problem is that can_assign_to_reg_p() returns true when x is > (ashift:HI (reg/v:HI 27 [ n ]) (subreg:QI (reg/v:HI 27 [ n ]) 0)). > num_clobbers == 1 but added_clobbers_hard_reg_p returns false. > > It seems to me that store motion is OK here, but I don't know who is > usually responsible for adding the clobbers....
In the rest of gcse.c this works because of process_insert_insn(), which uses insn_invalid_p() to add clobbers if necessary. But it looks like update_ld_motion_stores() and insert_store() also call gen_move_insn without adding clobbers if necessary. I suppose the insns produced there should also go through insn_invalid_p somewhere. I sent a hack for that to DJ, but I guess the proper place to fix this is inside gcse.c itself. Gr. Steven