sparc.md (setjmp): Handle PIC mode and use the hard frame pointer.
* config/sparc/sparc.md (setjmp): Handle PIC mode and use the hard frame pointer. From-SVN: r174013
This commit is contained in:
parent
bd9a3248ab
commit
abd9a770ee
|
@ -1,3 +1,8 @@
|
||||||
|
2011-05-21 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
|
* config/sparc/sparc.md (setjmp): Handle PIC mode and use the hard
|
||||||
|
frame pointer.
|
||||||
|
|
||||||
2011-05-21 Eric Botcazou <ebotcazou@adacore.com>
|
2011-05-21 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
* config/sparc/sparc.c (eligible_for_return_delay): Do not return
|
* config/sparc/sparc.c (eligible_for_return_delay): Do not return
|
||||||
|
|
|
@ -6507,8 +6507,8 @@
|
||||||
(const_int 4)))])
|
(const_int 4)))])
|
||||||
|
|
||||||
;; For __builtin_setjmp we need to flush register windows iff the function
|
;; For __builtin_setjmp we need to flush register windows iff the function
|
||||||
;; calls alloca as well, because otherwise the register window might be
|
;; calls alloca as well, because otherwise the current register window might
|
||||||
;; saved after %sp adjustment and thus setjmp would crash
|
;; be saved after the %sp adjustment and thus setjmp would crash.
|
||||||
(define_expand "builtin_setjmp_setup"
|
(define_expand "builtin_setjmp_setup"
|
||||||
[(match_operand 0 "register_operand" "r")]
|
[(match_operand 0 "register_operand" "r")]
|
||||||
""
|
""
|
||||||
|
@ -6547,19 +6547,26 @@
|
||||||
(eq_attr "pic" "true")
|
(eq_attr "pic" "true")
|
||||||
(const_int 4)] (const_int 3)))])
|
(const_int 4)] (const_int 3)))])
|
||||||
|
|
||||||
;; Pattern for use after a setjmp to store FP and the return register
|
;; Pattern for use after a setjmp to store registers into the save area.
|
||||||
;; into the stack area.
|
|
||||||
|
|
||||||
(define_expand "setjmp"
|
(define_expand "setjmp"
|
||||||
[(const_int 0)]
|
[(const_int 0)]
|
||||||
""
|
""
|
||||||
{
|
{
|
||||||
rtx mem;
|
rtx mem;
|
||||||
|
|
||||||
|
if (flag_pic)
|
||||||
|
{
|
||||||
|
mem = gen_rtx_MEM (Pmode,
|
||||||
|
plus_constant (stack_pointer_rtx,
|
||||||
|
SPARC_STACK_BIAS + 7 * UNITS_PER_WORD));
|
||||||
|
emit_insn (gen_rtx_SET (VOIDmode, mem, pic_offset_table_rtx));
|
||||||
|
}
|
||||||
|
|
||||||
mem = gen_rtx_MEM (Pmode,
|
mem = gen_rtx_MEM (Pmode,
|
||||||
plus_constant (stack_pointer_rtx,
|
plus_constant (stack_pointer_rtx,
|
||||||
SPARC_STACK_BIAS + 14 * UNITS_PER_WORD));
|
SPARC_STACK_BIAS + 14 * UNITS_PER_WORD));
|
||||||
emit_insn (gen_rtx_SET (VOIDmode, mem, frame_pointer_rtx));
|
emit_insn (gen_rtx_SET (VOIDmode, mem, hard_frame_pointer_rtx));
|
||||||
|
|
||||||
mem = gen_rtx_MEM (Pmode,
|
mem = gen_rtx_MEM (Pmode,
|
||||||
plus_constant (stack_pointer_rtx,
|
plus_constant (stack_pointer_rtx,
|
||||||
|
|
Loading…
Reference in New Issue