/* Warn if this value is an aggregate type,
regardless of which calling convention we are using for it. */
- if (warn_aggregate_return
- && (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == QUAL_UNION_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE))
+ if (warn_aggregate_return && AGGREGATE_TYPE_P (TREE_TYPE (exp)))
warning ("function call has aggregate value");
/* Set up a place to return a structure. */
copy = assign_stack_temp (TYPE_MODE (type), size, 1);
}
- MEM_IN_STRUCT_P (copy)
- = (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE
- || TREE_CODE (type) == ARRAY_TYPE);
+ MEM_IN_STRUCT_P (copy) = AGGREGATE_TYPE_P (type);
store_expr (args[i].tree_value, copy, 0);
addr = plus_constant (addr, arg_offset);
args[i].stack = gen_rtx (MEM, args[i].mode, addr);
MEM_IN_STRUCT_P (args[i].stack)
- = (TREE_CODE (TREE_TYPE (args[i].tree_value)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (args[i].tree_value)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (args[i].tree_value)) == QUAL_UNION_TYPE
- || TREE_CODE (TREE_TYPE (args[i].tree_value)) == ARRAY_TYPE);
+ = AGGREGATE_TYPE_P (TREE_TYPE (args[i].tree_value));
if (GET_CODE (slot_offset) == CONST_INT)
addr = plus_constant (arg_reg, INTVAL (slot_offset));
target = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
memory_address (TYPE_MODE (TREE_TYPE (exp)),
structure_value_addr));
- MEM_IN_STRUCT_P (target)
- = (TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == QUAL_UNION_TYPE);
+ MEM_IN_STRUCT_P (target) = AGGREGATE_TYPE_P (TREE_TYPE (exp));
}
}
else if (pcc_struct_value)
int_size_in_bytes (TREE_TYPE (exp)),
0);
- MEM_IN_STRUCT_P (target)
- = (TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == QUAL_UNION_TYPE);
+ MEM_IN_STRUCT_P (target) = AGGREGATE_TYPE_P (TREE_TYPE (exp));
/* Save this temp slot around the pop below. */
preserve_temp_slots (target);
{
temp
= assign_stack_temp (mode, int_size_in_bytes (type), 0);
- MEM_IN_STRUCT_P (temp)
- = (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE
- || TREE_CODE (type) == ARRAY_TYPE);
+ MEM_IN_STRUCT_P (temp) = AGGREGATE_TYPE_P (type);
}
else
temp = gen_reg_rtx (promote_mode (type, mode, &unsignedp, 0));
target = gen_reg_rtx (tmode != VOIDmode ? tmode : mode);
else
{
- enum tree_code c = TREE_CODE (type);
target
= assign_stack_temp (mode, int_size_in_bytes (type), 0);
- if (c == RECORD_TYPE || c == UNION_TYPE
- || c == QUAL_UNION_TYPE || c == ARRAY_TYPE)
+ if (AGGREGATE_TYPE_P (type))
MEM_IN_STRUCT_P (target) = 1;
}
}
if (TREE_CODE (TREE_OPERAND (exp, 0)) == PLUS_EXPR
|| (TREE_CODE (TREE_OPERAND (exp, 0)) == SAVE_EXPR
&& TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) == PLUS_EXPR)
- || TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == QUAL_UNION_TYPE
+ || AGGREGATE_TYPE_P (TREE_TYPE (exp))
|| (TREE_CODE (exp1) == ADDR_EXPR
&& (exp2 = TREE_OPERAND (exp1, 0))
- && (TREE_CODE (TREE_TYPE (exp2)) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (exp2)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (exp2)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (exp2)) == QUAL_UNION_TYPE)))
+ && AGGREGATE_TYPE_P (TREE_TYPE (exp2))))
MEM_IN_STRUCT_P (temp) = 1;
MEM_VOLATILE_P (temp) = TREE_THIS_VOLATILE (exp) | flag_volatile;
#if 0 /* It is incorrect to set RTX_UNCHANGING_P here, because the fact that
(TREE_INT_CST_LOW (TYPE_SIZE (type))
+ BITS_PER_UNIT - 1)
/ BITS_PER_UNIT, 0);
- MEM_IN_STRUCT_P (temp)
- = (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE
- || TREE_CODE (type) == ARRAY_TYPE);
+ MEM_IN_STRUCT_P (temp) = AGGREGATE_TYPE_P (type);
}
else
temp = gen_reg_rtx (mode);
/* If this is a memory ref that contains aggregate components,
mark it as such for cse and loop optimize. */
- MEM_IN_STRUCT_P (reg)
- = (TREE_CODE (type) == ARRAY_TYPE
- || TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE);
+ MEM_IN_STRUCT_P (reg) = AGGREGATE_TYPE_P (type);
/* Now make sure that all refs to the variable, previously made
when it was a register, are fixed up to be valid again. */
if (RETURN_IN_MEMORY (type))
return 1;
- if (flag_pcc_struct_return
- && (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == QUAL_UNION_TYPE
- || TREE_CODE (type) == ARRAY_TYPE))
+ if (flag_pcc_struct_return && AGGREGATE_TYPE_P (type))
return 1;
/* Make sure we have suitable call-clobbered regs to return
the value in; if not, we must return it in memory. */
for (parm = fnargs; parm; parm = TREE_CHAIN (parm))
{
- int aggregate
- = (TREE_CODE (TREE_TYPE (parm)) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (parm)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (parm)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (parm)) == QUAL_UNION_TYPE);
+ int aggregate = AGGREGATE_TYPE_P (TREE_TYPE (parm));
struct args_size stack_offset;
struct args_size arg_size;
int passed_pointer = 0;
DECL_RTL (result)
= gen_rtx (MEM, DECL_MODE (result), DECL_RTL (parm));
- MEM_IN_STRUCT_P (DECL_RTL (result))
- = (TREE_CODE (restype) == RECORD_TYPE
- || TREE_CODE (restype) == UNION_TYPE
- || TREE_CODE (restype) == QUAL_UNION_TYPE
- || TREE_CODE (restype) == ARRAY_TYPE);
+ MEM_IN_STRUCT_P (DECL_RTL (result)) = AGGREGATE_TYPE_P (restype);
}
if (TREE_THIS_VOLATILE (parm))
because assigning the fields one by one can fail to convince
flow.c that the entire aggregate was initialized.
Unions are troublesome because members may be shorter. */
- && TREE_CODE (TREE_TYPE (decl)) != RECORD_TYPE
- && TREE_CODE (TREE_TYPE (decl)) != UNION_TYPE
- && TREE_CODE (TREE_TYPE (decl)) != QUAL_UNION_TYPE
- && TREE_CODE (TREE_TYPE (decl)) != ARRAY_TYPE
+ && ! AGGREGATE_TYPE_P (TREE_TYPE (decl))
&& DECL_RTL (decl) != 0
&& GET_CODE (DECL_RTL (decl)) == REG
&& regno_uninitialized (REGNO (DECL_RTL (decl))))
/* Warn if this value is an aggregate type,
regardless of which calling convention we are using for it. */
if (warn_aggregate_return
- && (TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == QUAL_UNION_TYPE
- || TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == ARRAY_TYPE))
+ && AGGREGATE_TYPE_P (TREE_TYPE (DECL_RESULT (subr))))
warning ("function returns an aggregate");
current_function_returns_pointer
DECL_RTL (DECL_RESULT (subr))
= gen_rtx (MEM, DECL_MODE (DECL_RESULT (subr)), value_address);
MEM_IN_STRUCT_P (DECL_RTL (DECL_RESULT (subr)))
- = (TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == QUAL_UNION_TYPE
- || TREE_CODE (TREE_TYPE (DECL_RESULT (subr))) == ARRAY_TYPE);
+ = AGGREGATE_TYPE_P (TREE_TYPE (DECL_RESULT (subr)));
}
}
else if (DECL_MODE (DECL_RESULT (subr)) == VOIDmode)
/* If this is a memory ref that contains aggregate components,
mark it as such for cse and loop optimize. */
- MEM_IN_STRUCT_P (DECL_RTL (decl))
- = (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (decl)) == QUAL_UNION_TYPE);
+ MEM_IN_STRUCT_P (DECL_RTL (decl)) = AGGREGATE_TYPE_P (TREE_TYPE (decl));
#if 0
/* If this is in memory because of -ffloat-store,
set the volatile bit, to prevent optimizations from
/* If this is a memory ref that contains aggregate components,
mark it as such for cse and loop optimize. */
- MEM_IN_STRUCT_P (DECL_RTL (decl))
- = (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (decl)) == QUAL_UNION_TYPE);
+ MEM_IN_STRUCT_P (DECL_RTL (decl)) = AGGREGATE_TYPE_P (TREE_TYPE (decl));
/* Indicate the alignment we actually gave this variable. */
#ifdef STACK_BOUNDARY
if (TREE_READONLY (decl))
RTX_UNCHANGING_P (DECL_RTL (decl)) = 1;
MEM_IN_STRUCT_P (DECL_RTL (decl))
- = (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE
- || TREE_CODE (TREE_TYPE (decl)) == QUAL_UNION_TYPE);
+ = AGGREGATE_TYPE_P (TREE_TYPE (decl));
/* Optionally set flags or add text to the name to record information
such as that it is a function name.
TREE_CST_RTL (exp)
= gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)), def);
RTX_UNCHANGING_P (TREE_CST_RTL (exp)) = 1;
- if (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE)
+ if (AGGREGATE_TYPE_P (TREE_TYPE (exp)))
MEM_IN_STRUCT_P (TREE_CST_RTL (exp)) = 1;
pop_obstacks ();