summaryrefslogtreecommitdiffstats
path: root/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0050-PR-target-58595.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0050-PR-target-58595.patch')
-rw-r--r--meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0050-PR-target-58595.patch101
1 files changed, 101 insertions, 0 deletions
diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0050-PR-target-58595.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0050-PR-target-58595.patch
new file mode 100644
index 0000000..62a3994
--- /dev/null
+++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0050-PR-target-58595.patch
@@ -0,0 +1,101 @@
1Backport fix for PR target/58595
2
3From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
4Date: Thu, 6 Mar 2014 12:07:07 +0000
5Subject: [PATCH] PR target/58595 * config/arm/arm.c
6 (arm_tls_symbol_p): Remove. (arm_legitimize_address): Call
7 legitimize_tls_address for any arm_tls_referenced_p expression,
8 handle constant addend. Call it before testing for !TARGET_ARM.
9 (thumb_legitimize_address): Don't handle arm_tls_symbol_p here.
10
11 * gcc.dg/tls/pr58595.c: New test.
12
13
14git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208380 138bc75d-0d04-0410-961f-82ee72b054a4
15
16Index: gcc-4.8.2/gcc/config/arm/arm.c
17===================================================================
18--- gcc-4.8.2.orig/gcc/config/arm/arm.c
19+++ gcc-4.8.2/gcc/config/arm/arm.c
20@@ -230,7 +230,6 @@ static tree arm_gimplify_va_arg_expr (tr
21 static void arm_option_override (void);
22 static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode);
23 static bool arm_cannot_copy_insn_p (rtx);
24-static bool arm_tls_symbol_p (rtx x);
25 static int arm_issue_rate (void);
26 static void arm_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
27 static bool arm_output_addr_const_extra (FILE *, rtx);
28@@ -6573,6 +6572,32 @@ legitimize_tls_address (rtx x, rtx reg)
29 rtx
30 arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
31 {
32+ if (arm_tls_referenced_p (x))
33+ {
34+ rtx addend = NULL;
35+
36+ if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
37+ {
38+ addend = XEXP (XEXP (x, 0), 1);
39+ x = XEXP (XEXP (x, 0), 0);
40+ }
41+
42+ if (GET_CODE (x) != SYMBOL_REF)
43+ return x;
44+
45+ gcc_assert (SYMBOL_REF_TLS_MODEL (x) != 0);
46+
47+ x = legitimize_tls_address (x, NULL_RTX);
48+
49+ if (addend)
50+ {
51+ x = gen_rtx_PLUS (SImode, x, addend);
52+ orig_x = x;
53+ }
54+ else
55+ return x;
56+ }
57+
58 if (!TARGET_ARM)
59 {
60 /* TODO: legitimize_address for Thumb2. */
61@@ -6581,9 +6606,6 @@ arm_legitimize_address (rtx x, rtx orig_
62 return thumb_legitimize_address (x, orig_x, mode);
63 }
64
65- if (arm_tls_symbol_p (x))
66- return legitimize_tls_address (x, NULL_RTX);
67-
68 if (GET_CODE (x) == PLUS)
69 {
70 rtx xop0 = XEXP (x, 0);
71@@ -6695,9 +6717,6 @@ arm_legitimize_address (rtx x, rtx orig_
72 rtx
73 thumb_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
74 {
75- if (arm_tls_symbol_p (x))
76- return legitimize_tls_address (x, NULL_RTX);
77-
78 if (GET_CODE (x) == PLUS
79 && CONST_INT_P (XEXP (x, 1))
80 && (INTVAL (XEXP (x, 1)) >= 32 * GET_MODE_SIZE (mode)
81@@ -6988,20 +7007,6 @@ thumb_legitimize_reload_address (rtx *x_
82
83 /* Test for various thread-local symbols. */
84
85-/* Return TRUE if X is a thread-local symbol. */
86-
87-static bool
88-arm_tls_symbol_p (rtx x)
89-{
90- if (! TARGET_HAVE_TLS)
91- return false;
92-
93- if (GET_CODE (x) != SYMBOL_REF)
94- return false;
95-
96- return SYMBOL_REF_TLS_MODEL (x) != 0;
97-}
98-
99 /* Helper for arm_tls_referenced_p. */
100
101 static int