On Thu, Jun 16, 2016 at 06:15:34PM +0200, Jakub Jelinek wrote:
> and then do in gimplify_modify_expr:
> ret = gimplify_expr (from_p, pre_p, post_p,
> is_gimple_reg (*to_p)
^^^ of course even this is a prediction and wrong one for
DECL_HAS_VALUE_EXPR_Ps. Conservative would be is_whatever always.
> ? is_gimple_reg_rhs_or_call : is_whatever,
> fb_rvalue);
> if (ret == GS_ERROR)
> return ret;
>
> ret = gimplify_expr (to_p, pre_p, post_p, is_gimple_lvalue, fb_lvalue);
> if (ret == GS_ERROR)
> return ret;
>
> if (!is_gimple_reg (*to_p) && !is_gimple_mem_rhs_or_call (*from_p))
> {
> ret = gimplify_expr (from_p, pre_p, post_p, is_gimple_mem_rhs_or_call,
> fb_rvalue);
> if (ret == GS_ERROR)
> return ret;
> }
>
> Or if you want to guess if *to_p will be is_gimple_reg or not after
> gimplification, do it just very conservatively and let the more difficult
> to predict cases handled worst case by forcing something into a temporary
> with the above code.
Jakub