+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,
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);
(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")])