summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-11 09:23:32 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-11 09:23:32 +0000
commit738ab6f51ce3bb0ec1b2ee03249a0738db98b0cf (patch)
treeb700b07fc721a69f0f74991e6005fdca45a0e888 /gcc/function.c
parent88e81a691d4025461c124183e3a253f8a3ad351a (diff)
downloadgcc-738ab6f51ce3bb0ec1b2ee03249a0738db98b0cf.tar.gz
PR target/40668
* function.c (assign_parm_setup_stack): Adjust MEM_OFFSET (data->stack_parm) if promoted_mode is different from nominal_mode on big endian. * gcc.c-torture/execute/pr40668.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149511 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 93244dba76b..258f5941950 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)