[RS6000] Stop regrename twiddling with split-stack prologue

PR target/70947
	* config/rs6000/rs6000.c (rs6000_expand_split_stack_prologue): Stop
	regrename modifying insns saving lr before __morestack call.
	* config/rs6000/rs6000.md (split_stack_return): Similarly for
	insns restoring lr after __morestack call.

From-SVN: r236052
This commit is contained in:
Alan Modra 2016-05-10 08:42:20 +09:30 committed by Alan Modra
parent 9491d081fe
commit 5def232a0b
3 changed files with 16 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2016-05-10 Alan Modra <amodra@gmail.com>
PR target/70947
* config/rs6000/rs6000.c (rs6000_expand_split_stack_prologue): Stop
regrename modifying insns saving lr before __morestack call.
* config/rs6000/rs6000.md (split_stack_return): Similarly for
insns restoring lr after __morestack call.
2016-05-09 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.md (set_got, set_got_labelled, lwp_llwpcb,

View file

@ -27993,6 +27993,11 @@ rs6000_expand_split_stack_prologue (void)
const0_rtx, const0_rtx));
call_fusage = NULL_RTX;
use_reg (&call_fusage, r12);
/* Say the call uses r0, even though it doesn't, to stop regrename
from twiddling with the insns saving lr, trashing args for cfun.
The insns restoring lr are similarly protected by making
split_stack_return use r0. */
use_reg (&call_fusage, r0);
add_function_usage_to (insn, call_fusage);
emit_insn (gen_frame_load (r0, r1, info->lr_save_offset));
insn = emit_move_insn (lr, r0);

View file

@ -12587,8 +12587,10 @@
(set_attr "indexed" "no")])
;; A return instruction which the middle-end doesn't see.
;; Use r0 to stop regrename twiddling with lr restore insns emitted
;; after the call to __morestack.
(define_insn "split_stack_return"
[(unspec_volatile [(const_int 0)] UNSPECV_SPLIT_STACK_RETURN)]
[(unspec_volatile [(use (reg:SI 0))] UNSPECV_SPLIT_STACK_RETURN)]
""
"blr"
[(set_attr "type" "jmpreg")])