cp-gimplify.c (cp_gimplify_expr): Use get_initialized_tmp_var.
* cp-gimplify.c (cp_gimplify_expr): Use get_initialized_tmp_var. The comment for get_formal_tmp_var says that it shouldn't be used for expressions whose value might change between initialization and use, and in this case we're creating a temporary precisely because the value might change, so we should use get_initialized_tmp_var instead. I also noticed that many callers of get_initialized_tmp_var pass NULL for post_p, so it seems appropriate to make it a default argument. gcc/ * gimplify.h (get_initialized_tmp_var): Add default argument to post_p. * gimplify.c (gimplify_self_mod_expr, gimplify_omp_atomic): Remove NULL post_p argument. * targhooks (std_gimplify_va_arg_expr): Likewise. From-SVN: r277128
This commit is contained in:
parent
c11cccc028
commit
8e5993e236
|
@ -1,3 +1,11 @@
|
||||||
|
2019-10-17 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* gimplify.h (get_initialized_tmp_var): Add default argument to
|
||||||
|
post_p.
|
||||||
|
* gimplify.c (gimplify_self_mod_expr, gimplify_omp_atomic): Remove
|
||||||
|
NULL post_p argument.
|
||||||
|
* targhooks (std_gimplify_va_arg_expr): Likewise.
|
||||||
|
|
||||||
2019-10-17 Richard Biener <rguenther@suse.de>
|
2019-10-17 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
* tree-vectorizer.h (_stmt_vec_info::cond_reduc_code): Remove.
|
* tree-vectorizer.h (_stmt_vec_info::cond_reduc_code): Remove.
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2019-10-17 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* cp-gimplify.c (cp_gimplify_expr): Use get_initialized_tmp_var.
|
||||||
|
(gimplify_to_rvalue): Remove default NULL argument.
|
||||||
|
|
||||||
2019-10-17 Nathan Sidwell <nathan@acm.org>
|
2019-10-17 Nathan Sidwell <nathan@acm.org>
|
||||||
|
|
||||||
* decl.c (builtin_function_1): Merge into ...
|
* decl.c (builtin_function_1): Merge into ...
|
||||||
|
|
|
@ -650,7 +650,7 @@ gimplify_to_rvalue (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
||||||
if (t == GS_ERROR)
|
if (t == GS_ERROR)
|
||||||
return GS_ERROR;
|
return GS_ERROR;
|
||||||
else if (is_gimple_variable (*expr_p) && TREE_CODE (*expr_p) != SSA_NAME)
|
else if (is_gimple_variable (*expr_p) && TREE_CODE (*expr_p) != SSA_NAME)
|
||||||
*expr_p = get_initialized_tmp_var (*expr_p, pre_p, NULL);
|
*expr_p = get_initialized_tmp_var (*expr_p, pre_p);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -767,7 +767,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
|
||||||
&& (TREE_CODE (op1) == CALL_EXPR
|
&& (TREE_CODE (op1) == CALL_EXPR
|
||||||
|| (SCALAR_TYPE_P (TREE_TYPE (op1))
|
|| (SCALAR_TYPE_P (TREE_TYPE (op1))
|
||||||
&& !TREE_CONSTANT (op1))))
|
&& !TREE_CONSTANT (op1))))
|
||||||
TREE_OPERAND (*expr_p, 1) = get_formal_tmp_var (op1, pre_p);
|
TREE_OPERAND (*expr_p, 1) = get_initialized_tmp_var (op1, pre_p);
|
||||||
}
|
}
|
||||||
ret = GS_OK;
|
ret = GS_OK;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -661,8 +661,9 @@ get_formal_tmp_var (tree val, gimple_seq *pre_p)
|
||||||
are as in gimplify_expr. */
|
are as in gimplify_expr. */
|
||||||
|
|
||||||
tree
|
tree
|
||||||
get_initialized_tmp_var (tree val, gimple_seq *pre_p, gimple_seq *post_p,
|
get_initialized_tmp_var (tree val, gimple_seq *pre_p,
|
||||||
bool allow_ssa)
|
gimple_seq *post_p /* = NULL */,
|
||||||
|
bool allow_ssa /* = true */)
|
||||||
{
|
{
|
||||||
return internal_get_tmp_var (val, pre_p, post_p, false, allow_ssa);
|
return internal_get_tmp_var (val, pre_p, post_p, false, allow_ssa);
|
||||||
}
|
}
|
||||||
|
@ -3149,7 +3150,7 @@ gimplify_self_mod_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
||||||
if (ret == GS_ERROR)
|
if (ret == GS_ERROR)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
lhs = get_initialized_tmp_var (lhs, pre_p, NULL);
|
lhs = get_initialized_tmp_var (lhs, pre_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For POINTERs increment, use POINTER_PLUS_EXPR. */
|
/* For POINTERs increment, use POINTER_PLUS_EXPR. */
|
||||||
|
@ -12688,7 +12689,7 @@ gimplify_omp_atomic (tree *expr_p, gimple_seq *pre_p)
|
||||||
tree bitsize;
|
tree bitsize;
|
||||||
tree tmp_store = tmp_load;
|
tree tmp_store = tmp_load;
|
||||||
if (TREE_CODE (*expr_p) == OMP_ATOMIC_CAPTURE_OLD)
|
if (TREE_CODE (*expr_p) == OMP_ATOMIC_CAPTURE_OLD)
|
||||||
tmp_store = get_initialized_tmp_var (tmp_load, pre_p, NULL);
|
tmp_store = get_initialized_tmp_var (tmp_load, pre_p);
|
||||||
if (INTEGRAL_TYPE_P (TREE_TYPE (op1)))
|
if (INTEGRAL_TYPE_P (TREE_TYPE (op1)))
|
||||||
bitsize = bitsize_int (TYPE_PRECISION (TREE_TYPE (op1)));
|
bitsize = bitsize_int (TYPE_PRECISION (TREE_TYPE (op1)));
|
||||||
else
|
else
|
||||||
|
|
|
@ -57,7 +57,7 @@ extern gbind *gimple_current_bind_expr (void);
|
||||||
extern vec<gbind *> gimple_bind_expr_stack (void);
|
extern vec<gbind *> gimple_bind_expr_stack (void);
|
||||||
extern void gimplify_and_add (tree, gimple_seq *);
|
extern void gimplify_and_add (tree, gimple_seq *);
|
||||||
extern tree get_formal_tmp_var (tree, gimple_seq *);
|
extern tree get_formal_tmp_var (tree, gimple_seq *);
|
||||||
extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *,
|
extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq * = NULL,
|
||||||
bool = true);
|
bool = true);
|
||||||
extern void declare_vars (tree, gimple *, bool);
|
extern void declare_vars (tree, gimple *, bool);
|
||||||
extern void gimple_add_tmp_var (tree);
|
extern void gimple_add_tmp_var (tree);
|
||||||
|
|
|
@ -2164,11 +2164,11 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
|
||||||
|
|
||||||
real_part = std_gimplify_va_arg_expr (valist,
|
real_part = std_gimplify_va_arg_expr (valist,
|
||||||
TREE_TYPE (type), pre_p, NULL);
|
TREE_TYPE (type), pre_p, NULL);
|
||||||
real_part = get_initialized_tmp_var (real_part, pre_p, NULL);
|
real_part = get_initialized_tmp_var (real_part, pre_p);
|
||||||
|
|
||||||
imag_part = std_gimplify_va_arg_expr (unshare_expr (valist),
|
imag_part = std_gimplify_va_arg_expr (unshare_expr (valist),
|
||||||
TREE_TYPE (type), pre_p, NULL);
|
TREE_TYPE (type), pre_p, NULL);
|
||||||
imag_part = get_initialized_tmp_var (imag_part, pre_p, NULL);
|
imag_part = get_initialized_tmp_var (imag_part, pre_p);
|
||||||
|
|
||||||
return build2 (COMPLEX_EXPR, type, real_part, imag_part);
|
return build2 (COMPLEX_EXPR, type, real_part, imag_part);
|
||||||
}
|
}
|
||||||
|
@ -2186,7 +2186,7 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
|
||||||
boundary /= BITS_PER_UNIT;
|
boundary /= BITS_PER_UNIT;
|
||||||
|
|
||||||
/* Hoist the valist value into a temporary for the moment. */
|
/* Hoist the valist value into a temporary for the moment. */
|
||||||
valist_tmp = get_initialized_tmp_var (valist, pre_p, NULL);
|
valist_tmp = get_initialized_tmp_var (valist, pre_p);
|
||||||
|
|
||||||
/* va_list pointer is aligned to PARM_BOUNDARY. If argument actually
|
/* va_list pointer is aligned to PARM_BOUNDARY. If argument actually
|
||||||
requires greater alignment, we must perform dynamic alignment. */
|
requires greater alignment, we must perform dynamic alignment. */
|
||||||
|
|
Loading…
Reference in New Issue