summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0301-config-sparc-sparc.md-setjmp-Handle-PIC-mode-and-use.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0301-config-sparc-sparc.md-setjmp-Handle-PIC-mode-and-use.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0301-config-sparc-sparc.md-setjmp-Handle-PIC-mode-and-use.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0301-config-sparc-sparc.md-setjmp-Handle-PIC-mode-and-use.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0301-config-sparc-sparc.md-setjmp-Handle-PIC-mode-and-use.patch
new file mode 100644
index 0000000000..0b827c1178
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0301-config-sparc-sparc.md-setjmp-Handle-PIC-mode-and-use.patch
@@ -0,0 +1,56 @@
1From 0a4d0f222b48850a59769bc1d53327ea4c819e8b Mon Sep 17 00:00:00 2001
2From: ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Sat, 21 May 2011 22:49:41 +0000
4Subject: [PATCH] * config/sparc/sparc.md (setjmp): Handle PIC mode and use the hard
5 frame pointer.
6
7git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174014 138bc75d-0d04-0410-961f-82ee72b054a4
8
9index 853bd2f..5e16179 100644
10--- a/gcc/config/sparc/sparc.md
11+++ b/gcc/config/sparc/sparc.md
12@@ -6507,8 +6507,8 @@
13 (const_int 4)))])
14
15 ;; For __builtin_setjmp we need to flush register windows iff the function
16-;; calls alloca as well, because otherwise the register window might be
17-;; saved after %sp adjustment and thus setjmp would crash
18+;; calls alloca as well, because otherwise the current register window might
19+;; be saved after the %sp adjustment and thus setjmp would crash.
20 (define_expand "builtin_setjmp_setup"
21 [(match_operand 0 "register_operand" "r")]
22 ""
23@@ -6547,19 +6547,26 @@
24 (eq_attr "pic" "true")
25 (const_int 4)] (const_int 3)))])
26
27-;; Pattern for use after a setjmp to store FP and the return register
28-;; into the stack area.
29+;; Pattern for use after a setjmp to store registers into the save area.
30
31 (define_expand "setjmp"
32 [(const_int 0)]
33 ""
34 {
35 rtx mem;
36-
37+
38+ if (flag_pic)
39+ {
40+ mem = gen_rtx_MEM (Pmode,
41+ plus_constant (stack_pointer_rtx,
42+ SPARC_STACK_BIAS + 7 * UNITS_PER_WORD));
43+ emit_insn (gen_rtx_SET (VOIDmode, mem, pic_offset_table_rtx));
44+ }
45+
46 mem = gen_rtx_MEM (Pmode,
47 plus_constant (stack_pointer_rtx,
48 SPARC_STACK_BIAS + 14 * UNITS_PER_WORD));
49- emit_insn (gen_rtx_SET (VOIDmode, mem, frame_pointer_rtx));
50+ emit_insn (gen_rtx_SET (VOIDmode, mem, hard_frame_pointer_rtx));
51
52 mem = gen_rtx_MEM (Pmode,
53 plus_constant (stack_pointer_rtx,
54--
551.7.0.4
56