diff options
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/function.c b/gcc/function.c index 93244dba76b..e31c12ada35 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2976,9 +2976,17 @@ assign_parm_setup_stack (struct assign_parm_data_all *all, tree parm, TYPE_UNSIGNED (TREE_TYPE (parm))); if (data->stack_parm) - /* ??? This may need a big-endian conversion on sparc64. */ - data->stack_parm - = adjust_address (data->stack_parm, data->nominal_mode, 0); + { + int offset = subreg_lowpart_offset (data->nominal_mode, + GET_MODE (data->stack_parm)); + /* ??? This may need a big-endian conversion on sparc64. */ + data->stack_parm + = adjust_address (data->stack_parm, data->nominal_mode, 0); + if (offset && MEM_OFFSET (data->stack_parm)) + set_mem_offset (data->stack_parm, + plus_constant (MEM_OFFSET (data->stack_parm), + offset)); + } } if (data->entry_parm != data->stack_parm) @@ -3138,8 +3146,12 @@ assign_parms (tree fndecl) { unsigned int align = FUNCTION_ARG_BOUNDARY (data.promoted_mode, data.passed_type); + align = MINIMUM_ALIGNMENT (data.passed_type, data.promoted_mode, + align); if (TYPE_ALIGN (data.nominal_type) > align) - align = TYPE_ALIGN (data.passed_type); + align = MINIMUM_ALIGNMENT (data.nominal_type, + TYPE_MODE (data.nominal_type), + TYPE_ALIGN (data.nominal_type)); if (crtl->stack_alignment_estimated < align) { gcc_assert (!crtl->stack_realign_processed); |