[expr.c] PR target/65358 Avoid clobbering partial argument during sibcall
commita95e57762d0418d031feae89c90762758500c36e
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 May 2015 13:25:01 +0000 (27 13:25 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 May 2015 13:25:01 +0000 (27 13:25 +0000)
tree1f87b9fb46c70610a2b5ca644213e39984ef9d6a
parent3c9ef6293e6307d288aa213a2cb2047649d9b0c3
[expr.c] PR target/65358 Avoid clobbering partial argument during sibcall

PR target/65358
* expr.c (memory_load_overlap): New function.
(emit_push_insn): When pushing partial args to the stack would
clobber the register part load the overlapping part into a pseudo
and put it into the hard reg after pushing.  Change return type
to bool.  Add bool argument.
* expr.h (emit_push_insn): Change return type to bool.
Add bool argument.
* calls.c (expand_call): Cancel sibcall optimization when encountering
partial argument on targets with ARGS_GROW_DOWNWARD and
!STACK_GROWS_DOWNWARD.
(emit_library_call_value_1): Update callsite of emit_push_insn.
(store_one_arg): Likewise.

PR target/65358
* gcc.dg/pr65358.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223753 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/calls.c
gcc/expr.c
gcc/expr.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr65358.c [new file with mode: 0644]