alpha.c (alpha_return_in_memory): On VMS...
* 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. Co-Authored-By: Douglas B Rupp <rupp@gnat.com> Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com> From-SVN: r150652
This commit is contained in:
parent
2fa8205d74
commit
050d3f9d80
3 changed files with 35 additions and 10 deletions
|
@ -1,3 +1,15 @@
|
|||
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
|
||||
|
|
|
@ -5771,7 +5771,14 @@ alpha_return_in_memory (const_tree type, const_tree fndecl ATTRIBUTE_UNUSED)
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
@ -5842,7 +5849,10 @@ function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED,
|
|||
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:
|
||||
|
@ -5867,6 +5877,12 @@ function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED,
|
|||
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 ();
|
||||
}
|
||||
|
@ -6260,12 +6276,11 @@ alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
|||
|
||||
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
|
||||
|
|
|
@ -191,9 +191,7 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
|
|||
(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) \
|
||||
|
|
Loading…
Add table
Reference in a new issue