summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.7/ppc_no_crtsavres.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.7/ppc_no_crtsavres.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7/ppc_no_crtsavres.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.7/ppc_no_crtsavres.patch b/meta/recipes-devtools/gcc/gcc-4.7/ppc_no_crtsavres.patch
new file mode 100644
index 0000000000..92a5d9e176
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.7/ppc_no_crtsavres.patch
@@ -0,0 +1,72 @@
1Upstream-Status: Backport
2
3Signed-off-by: Khem Raj
4
5Source-url: http://gcc.gnu.org/ml/gcc-patches/2012-05/msg01362.html
6
7Currently, powerpc-linux gcc -Os -mno-multiple uses out-of-linux gpr
8save and restore functions when saving/restoring just one gpr. That's
9quite silly since the function call requires more instructions and is
10slower than an inline save/restore. The only case where it might win
11is when no fprs are restored and the restore function can tear down
12the frame and exit (also loading up lr on ppc64). I guess that's how
13GP_SAVE_INLINE came to be like it is, ie. it's optimised for the
14common case using ldm in the prologue and no fprs. Still, it isn't
15difficult to choose the best combination in all cases, but it does
16mean different logic is needed for restores. I could have implemented
17GP_RESTORE_INLINE and FP_RESORE_INLINE macros but it seemed simpler to
18just move everything into the one place the macros are invoked. AIX
19and Darwin register cutoff doesn't change with this patch.
20
21This patch also enables out-of-line restores in cases that were
22previously disabled due to using inline saves.
23
24Bootstrapped and regression tested powerpc-linux. OK to apply?
25
26 * aix.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Delete.
27 * darwin.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Delete.
28 * sysv4.h (FP_SAVE_INLINE, GP_SAVE_INLINE, V_SAVE_INLINE): Delete.
29 * config/rs6000/rs6000.c (V_SAVE_INLINE): Delete.
30 (rs6000_savres_strategy): Reimplement GP/FP/V_SAVE_INLINE logic.
31 For ELF targets, use out-of-line restores for -Os and any number
32 of regs if the restore exits, and out-of-line gp save for two or
33 more regs. Use save_reg_p to test for holes in reg restore set.
34 Replace "#if" with "if".
35
36Index: gcc-4_7-branch/gcc/config/rs6000/aix.h
37===================================================================
38--- gcc-4_7-branch.orig/gcc/config/rs6000/aix.h 2012-09-07 12:35:35.000000000 -0700
39+++ gcc-4_7-branch/gcc/config/rs6000/aix.h 2012-09-07 15:27:55.215290315 -0700
40@@ -207,11 +207,6 @@
41 { "link_syscalls", LINK_SYSCALLS_SPEC }, \
42 { "link_libg", LINK_LIBG_SPEC }
43
44-/* Define cutoff for using external functions to save floating point. */
45-#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) == 62 || (FIRST_REG) == 63)
46-/* And similarly for general purpose registers. */
47-#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32)
48-
49 #define PROFILE_HOOK(LABEL) output_profile_hook (LABEL)
50
51 /* No version of AIX fully supports AltiVec or 64-bit instructions in
52Index: gcc-4_7-branch/gcc/config/rs6000/darwin.h
53===================================================================
54--- gcc-4_7-branch.orig/gcc/config/rs6000/darwin.h 2012-09-07 12:35:35.000000000 -0700
55+++ gcc-4_7-branch/gcc/config/rs6000/darwin.h 2012-09-07 15:27:55.223290316 -0700
56@@ -173,16 +173,6 @@
57 (RS6000_ALIGN (crtl->outgoing_args_size, 16) \
58 + (STACK_POINTER_OFFSET))
59
60-/* Define cutoff for using out-of-line functions to save registers.
61- Currently on Darwin, we implement FP and GPR out-of-line-saves plus the
62- special routine for 'save everything'. */
63-
64-#undef FP_SAVE_INLINE
65-#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) > 60 && (FIRST_REG) < 64)
66-
67-#undef GP_SAVE_INLINE
68-#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) > 29 && (FIRST_REG) < 32)
69-
70 /* Darwin uses a function call if everything needs to be saved/restored. */
71
72 #undef WORLD_SAVE_P