gimple_fold_builtin_clear_padding (gimple_stmt_iterator *gsi)
{
gimple *stmt = gsi_stmt (*gsi);
- gcc_assert (gimple_call_num_args (stmt) == 3);
+ gcc_assert (gimple_call_num_args (stmt) == 2);
tree ptr = gimple_call_arg (stmt, 0);
tree typearg = gimple_call_arg (stmt, 1);
- /* the 3rd argument of __builtin_clear_padding is to distinguish whether
- this call is made by the user or by the compiler for automatic variable
- initialization. */
- bool for_auto_init = (bool) TREE_INT_CST_LOW (gimple_call_arg (stmt, 2));
+ /* The 2nd argument of __builtin_clear_padding's value is used to
+ distinguish whether this call is made by the user or by the compiler
+ for automatic variable initialization. */
+ bool for_auto_init = (bool) TREE_INT_CST_LOW (typearg);
tree type = TREE_TYPE (TREE_TYPE (typearg));
location_t loc = gimple_location (stmt);
clear_padding_struct buf;
gimple_seq *seq_p)
{
tree addr_of_decl = NULL_TREE;
- bool for_auto_init = true;
tree fn = builtin_decl_explicit (BUILT_IN_CLEAR_PADDING);
if (is_vla)
addr_of_decl = build_fold_addr_expr (decl);
}
- gimple *call = gimple_build_call (fn,
- 3, addr_of_decl,
- build_zero_cst (TREE_TYPE (addr_of_decl)),
- build_int_cst (integer_type_node,
- (int) for_auto_init));
+ gimple *call = gimple_build_call (fn, 2, addr_of_decl,
+ build_one_cst (TREE_TYPE (addr_of_decl)));
gimplify_seq_add_stmt (seq_p, call);
}
{
/* Remember the original type of the argument in an internal
dummy second argument, as in GIMPLE pointer conversions are
- useless. also mark this call as not for automatic initialization
- in the internal dummy third argument. */
+ useless. Also mark this call as not for automatic
+ initialization in the internal dummy third argument. */
p = CALL_EXPR_ARG (*expr_p, 0);
- bool for_auto_init = false;
*expr_p
- = build_call_expr_loc (EXPR_LOCATION (*expr_p), fndecl, 3, p,
- build_zero_cst (TREE_TYPE (p)),
- build_int_cst (integer_type_node,
- (int) for_auto_init));
+ = build_call_expr_loc (EXPR_LOCATION (*expr_p), fndecl, 2, p,
+ build_zero_cst (TREE_TYPE (p)));
return GS_OK;
}
break;
local_define_builtin ("__builtin_clear_padding", ftype,
BUILT_IN_CLEAR_PADDING,
"__builtin_clear_padding",
- ECF_LEAF | ECF_NOTHROW);
+ ECF_LEAF | ECF_NOTHROW);
}
if (!builtin_decl_explicit_p (BUILT_IN_UNREACHABLE)