* 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
+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>
* tree-vectorizer.h (_stmt_vec_info::cond_reduc_code): Remove.
+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>
* decl.c (builtin_function_1): Merge into ...
if (t == GS_ERROR)
return GS_ERROR;
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;
}
&& (TREE_CODE (op1) == CALL_EXPR
|| (SCALAR_TYPE_P (TREE_TYPE (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;
break;
are as in gimplify_expr. */
tree
-get_initialized_tmp_var (tree val, gimple_seq *pre_p, gimple_seq *post_p,
- bool allow_ssa)
+get_initialized_tmp_var (tree val, gimple_seq *pre_p,
+ gimple_seq *post_p /* = NULL */,
+ bool allow_ssa /* = true */)
{
return internal_get_tmp_var (val, pre_p, post_p, false, allow_ssa);
}
if (ret == GS_ERROR)
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. */
tree bitsize;
tree tmp_store = tmp_load;
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)))
bitsize = bitsize_int (TYPE_PRECISION (TREE_TYPE (op1)));
else
extern vec<gbind *> gimple_bind_expr_stack (void);
extern void gimplify_and_add (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);
extern void declare_vars (tree, gimple *, bool);
extern void gimple_add_tmp_var (tree);
real_part = std_gimplify_va_arg_expr (valist,
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),
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);
}
boundary /= BITS_PER_UNIT;
/* 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
requires greater alignment, we must perform dynamic alignment. */