+2009-08-11 Vasiliy Fofanov <fofanov@adacore.com>
+ Eric Botcazou <botcazou@adacore.com>
+ Douglas B Rupp <rupp@gnat.com>
+
+ * config/alpha/alpha.c (alpha_return_in_memory): On VMS, ensure
+ that records that fit in 64 bits are returned by immediate value,
+ as required by OpenVMS Calling Standard.
+ (function_value): Adjust for above modification.
+ (alpha_va_start) <TARGET_ABI_OPEN_VMS>: Use
+ virtual_incoming_args_rtx as base object, not next_arg.
+ * config/alpha/vms.h: (DEFAULT_PCC_STRUCT_RETURN): Define as 0.
+
2009-08-11 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* reload.c (find_reloads_subreg_address): Check the original
{
mode = TYPE_MODE (type);
- /* All aggregates are returned in memory. */
+ /* All aggregates are returned in memory, except on OpenVMS where
+ records that fit 64 bits should be returned by immediate value
+ as required by section 3.8.7.1 of the OpenVMS Calling Standard. */
+ if (TARGET_ABI_OPEN_VMS
+ && TREE_CODE (type) != ARRAY_TYPE
+ && (unsigned HOST_WIDE_INT) int_size_in_bytes(type) <= 8)
+ return false;
+
if (AGGREGATE_TYPE_P (type))
return true;
}
switch (mclass)
{
case MODE_INT:
- PROMOTE_MODE (mode, dummy, valtype);
+ /* Do the same thing as PROMOTE_MODE except for libcalls on VMS,
+ where we have them returning both SImode and DImode. */
+ if (!(TARGET_ABI_OPEN_VMS && valtype && AGGREGATE_TYPE_P (valtype)))
+ PROMOTE_MODE (mode, dummy, valtype);
/* FALLTHRU */
case MODE_COMPLEX_INT:
GEN_INT (GET_MODE_SIZE (cmode)))));
}
+ case MODE_RANDOM:
+ /* We should only reach here for BLKmode on VMS. */
+ gcc_assert (TARGET_ABI_OPEN_VMS && mode == BLKmode);
+ regnum = 0;
+ break;
+
default:
gcc_unreachable ();
}
if (TARGET_ABI_OPEN_VMS)
{
- nextarg = plus_constant (nextarg, offset);
- nextarg = plus_constant (nextarg, NUM_ARGS * UNITS_PER_WORD);
- t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist,
- make_tree (ptr_type_node, nextarg));
+ t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
+ t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
+ size_int (offset + NUM_ARGS * UNITS_PER_WORD));
+ t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
TREE_SIDE_EFFECTS (t) = 1;
-
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
else
(CUM).num_args += ALPHA_ARG_SIZE (MODE, TYPE, NAMED); \
}
-/* ABI has stack checking, but it's broken. */
-#undef STACK_CHECK_BUILTIN
-#define STACK_CHECK_BUILTIN 0
+#define DEFAULT_PCC_STRUCT_RETURN 0
#undef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE, NAME) \