+2019-08-20 Richard Sandiford <richard.sandiford@arm.com>
+
+ * calls.h (pass_va_arg_by_reference): Declare.
+ * calls.c (pass_va_arg_by_reference): New function.
+ * config/aarch64/aarch64.c (aarch64_gimplify_va_arg_expr): Use it.
+ * config/alpha/alpha.c (alpha_gimplify_va_arg): Likewise.
+ * config/gcn/gcn.c (gcn_gimplify_va_arg_expr): Likewise.
+ * config/i386/i386.c (ix86_gimplify_va_arg): Likewise.
+ * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise.
+ * config/mips/mips.c (mips_std_gimplify_va_arg_expr): Likewise.
+ (mips_gimplify_va_arg_expr): Likewise.
+ * config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Likewise.
+ * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise.
+ * config/rs6000/rs6000-call.c (rs6000_gimplify_va_arg): Likewise.
+ * config/s390/s390.c (s390_gimplify_va_arg): Likewise.
+ * config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise.
+ * config/spu/spu.c (spu_gimplify_va_arg_expr): Likewise.
+ * config/tilegx/tilegx.c (tilegx_gimplify_va_arg_expr): Likewise.
+ * config/tilepro/tilepro.c (tilepro_gimplify_va_arg_expr): Likewise.
+ * config/visium/visium.c (visium_gimplify_va_arg): Likewise.
+ * config/xtensa/xtensa.c (xtensa_gimplify_va_arg_expr): Likewise.
+ * targhooks.c (std_gimplify_va_arg_expr): Likewise.
+
2019-08-20 Richard Biener <rguenther@suse.de>
PR target/91498
type, named_arg);
}
+/* Return true if TYPE should be passed by reference when passed to
+ the "..." arguments of a function. */
+
+bool
+pass_va_arg_by_reference (tree type)
+{
+ return pass_by_reference (NULL, TYPE_MODE (type), type, false);
+}
+
/* Return true if TYPE, which is passed by reference, should be callee
copied instead of caller copied. */
extern bool pass_by_reference (CUMULATIVE_ARGS *, machine_mode,
tree, bool);
+extern bool pass_va_arg_by_reference (tree);
extern bool reference_callee_copied (CUMULATIVE_ARGS *, machine_mode,
tree, bool);
extern void maybe_warn_alloc_args_overflow (tree, tree, tree[2], int[2]);
HOST_WIDE_INT size, rsize, adjust, align;
tree t, u, cond1, cond2;
- indirect_p = pass_by_reference (NULL, TYPE_MODE (type), type, false);
+ indirect_p = pass_va_arg_by_reference (type);
if (indirect_p)
type = build_pointer_type (type);
t = fold_convert (build_nonstandard_integer_type (64, 0), offset_field);
offset = get_initialized_tmp_var (t, pre_p, NULL);
- indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);
+ indirect = pass_va_arg_by_reference (type);
if (indirect)
{
tree t, u;
bool indirect;
- indirect = pass_by_reference (NULL, TYPE_MODE (type), type, 0);
+ indirect = pass_va_arg_by_reference (type);
if (indirect)
{
type = ptr;
ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE);
sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE);
- indirect_p = pass_by_reference (NULL, TYPE_MODE (type), type, false);
+ indirect_p = pass_va_arg_by_reference (type);
if (indirect_p)
type = build_pointer_type (type);
size = arg_int_size_in_bytes (type);
gimple_seq *post_p)
{
/* Variable sized types are passed by reference. */
- if (pass_by_reference (NULL, TYPE_MODE (type), type, false))
+ if (pass_va_arg_by_reference (type))
{
tree ptrtype = build_pointer_type (type);
tree addr = std_gimplify_va_arg_expr (valist, ptrtype, pre_p, post_p);
unsigned HOST_WIDE_INT align, boundary;
bool indirect;
- indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);
+ indirect = pass_va_arg_by_reference (type);
if (indirect)
type = build_pointer_type (type);
tree addr;
bool indirect_p;
- indirect_p = pass_by_reference (NULL, TYPE_MODE (type), type, 0);
+ indirect_p = pass_va_arg_by_reference (type);
if (indirect_p)
type = build_pointer_type (type);
unsigned HOST_WIDE_INT align, boundary;
bool indirect;
- indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);
+ indirect = pass_va_arg_by_reference (type);
if (indirect)
type = build_pointer_type (type);
unsigned int size, ofs;
bool indirect;
- indirect = pass_by_reference (NULL, TYPE_MODE (type), type, 0);
+ indirect = pass_va_arg_by_reference (type);
if (indirect)
{
type = ptr;
int regalign = 0;
gimple *stmt;
- if (pass_by_reference (NULL, TYPE_MODE (type), type, false))
+ if (pass_va_arg_by_reference (type))
{
t = rs6000_gimplify_va_arg (valist, ptrtype, pre_p, post_p);
return build_va_arg_indirect_ref (t);
s390_check_type_for_vector_abi (type, true, false);
- if (pass_by_reference (NULL, TYPE_MODE (type), type, false))
+ if (pass_va_arg_by_reference (type))
{
if (TARGET_DEBUG_ARG)
{
bool indirect;
tree ptrtype = build_pointer_type (type);
- if (pass_by_reference (NULL, TYPE_MODE (type), type, false))
+ if (pass_va_arg_by_reference (type))
{
indirect = true;
size = rsize = UNITS_PER_WORD;
/* if an object is dynamically sized, a pointer to it is passed
instead of the object itself. */
- pass_by_reference_p = pass_by_reference (NULL, TYPE_MODE (type), type,
- false);
+ pass_by_reference_p = pass_va_arg_by_reference (type);
if (pass_by_reference_p)
type = build_pointer_type (type);
size = int_size_in_bytes (type);
/* If an object is dynamically sized, a pointer to it is passed
instead of the object itself. */
- pass_by_reference_p = pass_by_reference (NULL, TYPE_MODE (type), type,
- false);
+ pass_by_reference_p = pass_va_arg_by_reference (type);
if (pass_by_reference_p)
type = build_pointer_type (type);
/* if an object is dynamically sized, a pointer to it is passed
instead of the object itself. */
- pass_by_reference_p = pass_by_reference (NULL, TYPE_MODE (type), type,
- false);
+ pass_by_reference_p = pass_va_arg_by_reference (type);
if (pass_by_reference_p)
type = build_pointer_type (type);
tree f_ovfl, f_gbase, f_fbase, f_gbytes, f_fbytes;
tree ovfl, base, bytes;
HOST_WIDE_INT size, rsize;
- const bool by_reference_p
- = pass_by_reference (NULL, TYPE_MODE (type), type, false);
+ const bool by_reference_p = pass_va_arg_by_reference (type);
const bool float_reg_arg_p
= (TARGET_FPU && !by_reference_p
&& ((GET_MODE_CLASS (TYPE_MODE (type)) == MODE_FLOAT
tree lab_false, lab_over, lab_false2;
bool indirect;
- indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);
+ indirect = pass_va_arg_by_reference (type);
if (indirect)
type = build_pointer_type (type);
if (ARGS_GROW_DOWNWARD)
gcc_unreachable ();
- indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);
+ indirect = pass_va_arg_by_reference (type);
if (indirect)
type = build_pointer_type (type);