[PR67753] adjust for padding when bypassing memory in assign_parm_setup_block
commit4b8026f85a902e5b5b4207ab1ab7ba16a7512b01
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 26 Nov 2015 21:57:40 +0000 (26 21:57 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 26 Nov 2015 21:57:40 +0000 (26 21:57 +0000)
tree5b030f1af1cc3c775d28f45c3afdaf55906e4e93
parentdb5ba70c2a5bac93791410a557b0d7d6e9f0b6bc
[PR67753] adjust for padding when bypassing memory in assign_parm_setup_block

Storing a register in memory as a full word and then accessing the
same memory address under a smaller-than-word mode amounts to
right-shifting of the register word on big endian machines.  So, if
BLOCK_REG_PADDING chooses upward padding for BYTES_BIG_ENDIAN, and
we're copying from the entry_parm REG directly to a pseudo, bypassing
any stack slot, perform the shifting explicitly.

This fixes the miscompile of function_return_val_10 in
gcc.target/aarch64/aapcs64/func-ret-4.c for target aarch64_be-elf
introduced in the first patch for 67753.

for  gcc/ChangeLog

PR rtl-optimization/67753
PR rtl-optimization/64164
* function.c (assign_parm_setup_block): Right-shift
upward-padded big-endian args when bypassing the stack slot.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230985 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/function.c