summaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
authorNathan Rossi <nathan.rossi@xilinx.com>2014-06-27 11:32:14 +1000
committerNathan Rossi <nathan.rossi@xilinx.com>2014-07-29 11:31:38 +1000
commitafe04ff799007b51a2e90a828f20df2137a04a90 (patch)
treed9f64be7a880d4e011425dcfc5d529f94fca574c /recipes-devtools
parent85a3fd72e3e2ccecddd70907d7e25859c4615334 (diff)
downloadmeta-xilinx-afe04ff799007b51a2e90a828f20df2137a04a90.tar.gz
gcc: Updated GCC 4.8 MicroBlaze patch
* Updated the MicroBlaze Thunk support patch. This patch has been accepted upstream, however it differs from the original patch. * The original patch was causing some issues with specific packages. Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/gcc/files/0462b5f-2014-02-23-David-Holsgrove-david.holsgrove.patch (renamed from recipes-devtools/gcc/files/0004-Patch-microblaze-Add-TARGET_ASM_OUTPUT_MI_THUNK-to-s.patch)72
-rw-r--r--recipes-devtools/gcc/gcc-microblaze-4.8.inc2
2 files changed, 33 insertions, 41 deletions
diff --git a/recipes-devtools/gcc/files/0004-Patch-microblaze-Add-TARGET_ASM_OUTPUT_MI_THUNK-to-s.patch b/recipes-devtools/gcc/files/0462b5f-2014-02-23-David-Holsgrove-david.holsgrove.patch
index 5d2665eb..efd127de 100644
--- a/recipes-devtools/gcc/files/0004-Patch-microblaze-Add-TARGET_ASM_OUTPUT_MI_THUNK-to-s.patch
+++ b/recipes-devtools/gcc/files/0462b5f-2014-02-23-David-Holsgrove-david.holsgrove.patch
@@ -1,35 +1,29 @@
1From: David Holsgrove <david.holsgrove@xilinx.com> 1From 0462b5fb1e91183c16e204e1a6cf436ef0d8d0f8 Mon Sep 17 00:00:00 2001
2Subject: [PATCH 4/8] [Patch, microblaze]: Add TARGET_ASM_OUTPUT_MI_THUNK to 2From: eager <eager@138bc75d-0d04-0410-961f-82ee72b054a4>
3 support varargs thunk 3Date: Sun, 23 Feb 2014 18:44:27 +0000
4Subject: [PATCH] 2014-02-23 David Holsgrove <david.holsgrove@xilinx.com>
4 5
5Without this macro, generic gcc generates a less efficient thunk 6 * /config/microblaze/microblaze.c: Add microblaze_asm_output_mi_thunk
6that calls function instead of jumping to it. The generic code 7 and define TARGET_ASM_OUTPUT_MI_THUNK and
7does not support varargs and produces an error message on compilation; 8 TARGET_ASM_CAN_OUTPUT_MI_THUNK.
8 9
9 error: generic thunk code fails for method 10Upstream-Status: Backport
10 'virtual void C::f(const char*, ...)' which uses '...' 11---
11 12 gcc/config/microblaze/microblaze.c | 73 ++++++++++++++++++++++++++++++++++++++
12Changelog 13 2 files changed, 79 insertions(+)
13
142013-03-18 David Holsgrove <david.holsgrove@xilinx.com>
15
16 * gcc/config/microblaze/microblaze.c: Add microblaze_asm_output_mi_thunk
17 and define TARGET_ASM_OUTPUT_MI_THUNK and TARGET_ASM_CAN_OUTPUT_MI_THUNK
18
19Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
20Upstream-Status: Pending
21 14
22diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c 15diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
23index 1562e60..7418e49 100644 16index 985d26a..ba8109b 100644
24--- a/gcc/config/microblaze/microblaze.c 17--- a/gcc/config/microblaze/microblaze.c
25+++ b/gcc/config/microblaze/microblaze.c 18+++ b/gcc/config/microblaze/microblaze.c
26@@ -3005,6 +3005,74 @@ microblaze_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED, 19@@ -3087,6 +3087,73 @@ expand_pic_symbol_ref (enum machine_mode mode ATTRIBUTE_UNUSED, rtx op)
20 return result;
27 } 21 }
28 22
29 static void 23+static void
30+microblaze_asm_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, 24+microblaze_asm_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
31+ HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, 25+ HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
32+ tree function) 26+ tree function)
33+{ 27+{
34+ rtx this_rtx, insn, funexp; 28+ rtx this_rtx, insn, funexp;
35+ 29+
@@ -54,14 +48,14 @@ index 1562e60..7418e49 100644
54+ if (vcall_offset) 48+ if (vcall_offset)
55+ { 49+ {
56+ rtx vcall_offset_rtx = GEN_INT (vcall_offset); 50+ rtx vcall_offset_rtx = GEN_INT (vcall_offset);
57+ rtx tmp = gen_rtx_REG (Pmode, MB_ABI_TEMP1_REGNUM); 51+ rtx temp1 = gen_rtx_REG (Pmode, MB_ABI_TEMP1_REGNUM);
58+ 52+
59+ emit_move_insn (tmp, gen_rtx_MEM (Pmode, this_rtx)); 53+ emit_move_insn (temp1, gen_rtx_MEM (Pmode, this_rtx));
60+ 54+
61+ rtx loc = gen_rtx_PLUS (Pmode, tmp, vcall_offset_rtx); 55+ rtx loc = gen_rtx_PLUS (Pmode, temp1, vcall_offset_rtx);
62+ emit_move_insn (tmp, gen_rtx_MEM (Pmode, loc)); 56+ emit_move_insn (temp1, gen_rtx_MEM (Pmode, loc));
63+ 57+
64+ emit_insn (gen_addsi3 (this_rtx, this_rtx, tmp)); 58+ emit_insn (gen_addsi3 (this_rtx, this_rtx, temp1));
65+ } 59+ }
66+ 60+
67+ /* Generate a tail call to the target function. */ 61+ /* Generate a tail call to the target function. */
@@ -70,17 +64,16 @@ index 1562e60..7418e49 100644
70+ assemble_external (function); 64+ assemble_external (function);
71+ TREE_USED (function) = 1; 65+ TREE_USED (function) = 1;
72+ } 66+ }
67+
73+ funexp = XEXP (DECL_RTL (function), 0); 68+ funexp = XEXP (DECL_RTL (function), 0);
69+ rtx temp2 = gen_rtx_REG (Pmode, MB_ABI_TEMP2_REGNUM);
74+ 70+
75+ if (flag_pic) 71+ if (flag_pic)
76+ { 72+ emit_move_insn (temp2, expand_pic_symbol_ref (Pmode, funexp));
77+ rtx scratch = gen_rtx_REG (Pmode, MB_ABI_TEMP2_REGNUM); 73+ else
78+ rtx reg = microblaze_legitimize_address(funexp, scratch, FUNCTION_MODE); 74+ emit_move_insn (temp2, funexp);
79+ emit_move_insn (scratch, reg);
80+ funexp = scratch;
81+ }
82+ 75+
83+ emit_insn (gen_jump (funexp)); 76+ emit_insn (gen_indirect_jump (temp2));
84+ 77+
85+ /* Run just enough of rest_of_compilation. This sequence was 78+ /* Run just enough of rest_of_compilation. This sequence was
86+ "borrowed" from rs6000.c. */ 79+ "borrowed" from rs6000.c. */
@@ -94,11 +87,10 @@ index 1562e60..7418e49 100644
94+ epilogue_completed = 0; 87+ epilogue_completed = 0;
95+} 88+}
96+ 89+
97+static void 90 bool
98 microblaze_globalize_label (FILE * stream, const char *name) 91 microblaze_expand_move (enum machine_mode mode, rtx operands[])
99 { 92 {
100 fputs ("\t.globl\t", stream); 93@@ -3504,6 +3571,12 @@ microblaze_legitimate_constant_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x
101@@ -3532,6 +3600,12 @@ microblaze_legitimate_constant_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x
102 #undef TARGET_SECONDARY_RELOAD 94 #undef TARGET_SECONDARY_RELOAD
103 #define TARGET_SECONDARY_RELOAD microblaze_secondary_reload 95 #define TARGET_SECONDARY_RELOAD microblaze_secondary_reload
104 96
@@ -112,5 +104,5 @@ index 1562e60..7418e49 100644
112 #define TARGET_SCHED_ADJUST_COST microblaze_adjust_cost 104 #define TARGET_SCHED_ADJUST_COST microblaze_adjust_cost
113 105
114-- 106--
1151.7.5.4 1071.9.0
116 108
diff --git a/recipes-devtools/gcc/gcc-microblaze-4.8.inc b/recipes-devtools/gcc/gcc-microblaze-4.8.inc
index 675ecaf0..f0578dbd 100644
--- a/recipes-devtools/gcc/gcc-microblaze-4.8.inc
+++ b/recipes-devtools/gcc/gcc-microblaze-4.8.inc
@@ -5,7 +5,7 @@ SRC_URI_append += " \
5 file://0001-Patch-microblaze-Enable-DWARF-exception-handling-sup.patch \ 5 file://0001-Patch-microblaze-Enable-DWARF-exception-handling-sup.patch \
6 file://0002-Patch-microblaze-Add-4-byte-implementation-for-atomi.patch \ 6 file://0002-Patch-microblaze-Add-4-byte-implementation-for-atomi.patch \
7 file://0003-Patch-microblaze-Extend-jump-insn-to-accept-bri-to-S.patch \ 7 file://0003-Patch-microblaze-Extend-jump-insn-to-accept-bri-to-S.patch \
8 file://0004-Patch-microblaze-Add-TARGET_ASM_OUTPUT_MI_THUNK-to-s.patch \ 8 file://0462b5f-2014-02-23-David-Holsgrove-david.holsgrove.patch \
9 file://0005-Patch-microblaze-Add-fstack-usage-support.patch \ 9 file://0005-Patch-microblaze-Add-fstack-usage-support.patch \
10 file://0006-Patch-microblaze-Remove-SECONDARY_MEMORY_NEEDED.patch \ 10 file://0006-Patch-microblaze-Remove-SECONDARY_MEMORY_NEEDED.patch \
11 file://0007-Patch-microblaze-Add-SIZE_TYPE-and-PTRDIFF_TYPE-to-m.patch \ 11 file://0007-Patch-microblaze-Add-SIZE_TYPE-and-PTRDIFF_TYPE-to-m.patch \