[expr.c] PR target/65358 Avoid clobbering partial argument during sibcall
commit99206968a8da4e5342b498f264eb365e11a499c8
authorKyrylo Tkachov <ktkachov@gcc.gnu.org>
Wed, 27 May 2015 13:25:01 +0000 (27 13:25 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Wed, 27 May 2015 13:25:01 +0000 (27 13:25 +0000)
tree1f87b9fb46c70610a2b5ca644213e39984ef9d6a
parent66371f94f55df849da15ffa9334868de99ac1f8c
[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.

From-SVN: r223753
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]