Prathamesh Kulkarni <prathamesh.kulka...@linaro.org> writes:
> @@ -1415,6 +1460,19 @@ forward_propagate_into (df_ref use)
>    if (!def_set)
>      return false;
>  
> +  if (reg_prop_only
> +      && !REG_P (SET_SRC (def_set))
> +      && !REG_P (SET_DEST (def_set)))
> +    return false;

This should be:

  if (reg_prop_only
      && (!REG_P (SET_SRC (def_set)) || !REG_P (SET_DEST (def_set))))
    return false;

so that we return false if either operand isn't a register.

> +
> +  /* Allow propagations into a loop only for reg-to-reg copies, since
> +     replacing one register by another shouldn't increase the cost.  */
> +
> +  if (DF_REF_BB (def)->loop_father != DF_REF_BB (use)->loop_father
> +      && !REG_P (SET_SRC (def_set))
> +      && !REG_P (SET_DEST (def_set)))
> +    return false;

Same here.

OK with that change, thanks.

Richard

Reply via email to