On 5 July 2013 16:18, Jakub Jelinek <[email protected]> wrote:
> On Fri, Jul 05, 2013 at 04:11:00PM +0800, Zhenqiang Chen wrote:
>> + FOR_BB_INSNS(bb, x)
>
> Just style nits:
> Missing space between (. Also, please don't use uppercase names
> for labels.
>
> Jakub
Thanks for the comments. Update it as:
diff --git a/gcc/function.c b/gcc/function.c
index 3e33fc7..0d15db4 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -5524,12 +5524,40 @@ move_insn_for_shrink_wrap (basic_block bb, rtx insn,
SET_REGNO_REG_SET (live_in, i);
}
+ /* DF_LR_BB_INFO (bb)->def does not cover the DF_REF_PARTIAL and
+ DF_REF_CONDITIONAL def. So recheck the DF_INSN_DEFS. */
+ if (next_block)
+ {
+ rtx x;
+ df_ref *def_rec;
+
+ FOR_BB_INSNS (bb, x)
+ {
+ if (!NONDEBUG_INSN_P (x))
+ continue;
+
+ for (def_rec = DF_INSN_DEFS (x); *def_rec; def_rec++)
+ {
+ df_ref def = *def_rec;
+ unsigned int regno = DF_REF_REGNO (def);
+
+ for (i = dregno; i < end_dregno; i++)
+ if (i == regno)
+ goto move_insn_done;
+ for (i = sregno; i < end_sregno; i++)
+ if (i == regno)
+ goto move_insn_done;
+ }
+ }
+ }
+
/* If we don't need to add the move to BB, look for a single
successor block. */
if (next_block)
next_block = next_block_for_reg (next_block, dregno, end_dregno);
}
while (next_block);
+move_insn_done:
/* BB now defines DEST. It only uses the parts of DEST that overlap SRC
(next loop). */