1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/gcc/4.7.3/100-fix-PR-target-58595.patch Thu Apr 17 18:17:12 2014 +0200
1.3 @@ -0,0 +1,102 @@
1.4 +commit 4fa1f8926227d4e79975b674dc4292b9bec4b137
1.5 +Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
1.6 +Date: Thu Mar 6 12:07:07 2014 +0000
1.7 +
1.8 + PR target/58595
1.9 + * config/arm/arm.c (arm_tls_symbol_p): Remove.
1.10 + (arm_legitimize_address): Call legitimize_tls_address for any
1.11 + arm_tls_referenced_p expression, handle constant addend. Call it
1.12 + before testing for !TARGET_ARM.
1.13 + (thumb_legitimize_address): Don't handle arm_tls_symbol_p here.
1.14 +
1.15 + * gcc.dg/tls/pr58595.c: New test.
1.16 +
1.17 +
1.18 + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208380 138bc75d-0d04-0410-961f-82ee72b054a4
1.19 +
1.20 +diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
1.21 +index ce24bfe..af5666b 100644
1.22 +--- a/gcc/config/arm/arm.c
1.23 ++++ b/gcc/config/arm/arm.c
1.24 +@@ -235,7 +235,6 @@ static tree arm_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
1.25 + static void arm_option_override (void);
1.26 + static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode);
1.27 + static bool arm_cannot_copy_insn_p (rtx);
1.28 +-static bool arm_tls_symbol_p (rtx x);
1.29 + static int arm_issue_rate (void);
1.30 + static void arm_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
1.31 + static bool arm_output_addr_const_extra (FILE *, rtx);
1.32 +@@ -7336,6 +7335,32 @@ legitimize_tls_address (rtx x, rtx reg)
1.33 + rtx
1.34 + arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
1.35 + {
1.36 ++ if (arm_tls_referenced_p (x))
1.37 ++ {
1.38 ++ rtx addend = NULL;
1.39 ++
1.40 ++ if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
1.41 ++ {
1.42 ++ addend = XEXP (XEXP (x, 0), 1);
1.43 ++ x = XEXP (XEXP (x, 0), 0);
1.44 ++ }
1.45 ++
1.46 ++ if (GET_CODE (x) != SYMBOL_REF)
1.47 ++ return x;
1.48 ++
1.49 ++ gcc_assert (SYMBOL_REF_TLS_MODEL (x) != 0);
1.50 ++
1.51 ++ x = legitimize_tls_address (x, NULL_RTX);
1.52 ++
1.53 ++ if (addend)
1.54 ++ {
1.55 ++ x = gen_rtx_PLUS (SImode, x, addend);
1.56 ++ orig_x = x;
1.57 ++ }
1.58 ++ else
1.59 ++ return x;
1.60 ++ }
1.61 ++
1.62 + if (!TARGET_ARM)
1.63 + {
1.64 + /* TODO: legitimize_address for Thumb2. */
1.65 +@@ -7344,9 +7369,6 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
1.66 + return thumb_legitimize_address (x, orig_x, mode);
1.67 + }
1.68 +
1.69 +- if (arm_tls_symbol_p (x))
1.70 +- return legitimize_tls_address (x, NULL_RTX);
1.71 +-
1.72 + if (GET_CODE (x) == PLUS)
1.73 + {
1.74 + rtx xop0 = XEXP (x, 0);
1.75 +@@ -7459,9 +7481,6 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
1.76 + rtx
1.77 + thumb_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
1.78 + {
1.79 +- if (arm_tls_symbol_p (x))
1.80 +- return legitimize_tls_address (x, NULL_RTX);
1.81 +-
1.82 + if (GET_CODE (x) == PLUS
1.83 + && CONST_INT_P (XEXP (x, 1))
1.84 + && (INTVAL (XEXP (x, 1)) >= 32 * GET_MODE_SIZE (mode)
1.85 +@@ -7756,20 +7775,6 @@ thumb_legitimize_reload_address (rtx *x_p,
1.86 +
1.87 + /* Test for various thread-local symbols. */
1.88 +
1.89 +-/* Return TRUE if X is a thread-local symbol. */
1.90 +-
1.91 +-static bool
1.92 +-arm_tls_symbol_p (rtx x)
1.93 +-{
1.94 +- if (! TARGET_HAVE_TLS)
1.95 +- return false;
1.96 +-
1.97 +- if (GET_CODE (x) != SYMBOL_REF)
1.98 +- return false;
1.99 +-
1.100 +- return SYMBOL_REF_TLS_MODEL (x) != 0;
1.101 +-}
1.102 +-
1.103 + /* Helper for arm_tls_referenced_p. */
1.104 +
1.105 + static int
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/patches/gcc/4.8.2/100-arm_expand_epilogue_apcs_frame-emit-blockage.patch Thu Apr 17 18:17:12 2014 +0200
2.3 @@ -0,0 +1,29 @@
2.4 +commit 9a228f68817f79bbd1d295b8e6fcaed25c47ee8f
2.5 +Author: ramana <ramana@138bc75d-0d04-0410-961f-82ee72b054a4>
2.6 +Date: Wed Oct 30 10:54:04 2013 +0000
2.7 +
2.8 + Fix PR target/58854
2.9 +
2.10 + 2013-10-30 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
2.11 +
2.12 + PR target/58854
2.13 + * config/arm/arm.c (arm_expand_epilogue_apcs_frame): Emit blockage.
2.14 +
2.15 +
2.16 + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204203 138bc75d-0d04-0410-961f-82ee72b054a4
2.17 +
2.18 +[yann.morin.1998@free.fr: removed the patch to the Changelog, it does not
2.19 + apply and we don't really need it; re-diff to avoid offsets]
2.20 +
2.21 +diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
2.22 +index 212a4bc..23dfc0e 100644
2.23 +--- a/gcc/config/arm/arm.c
2.24 ++++ b/gcc/config/arm/arm.c
2.25 +@@ -23555,6 +23555,7 @@ arm_expand_epilogue_apcs_frame (bool really_return)
2.26 + num_regs = bit_count (saved_regs_mask);
2.27 + if ((offsets->outgoing_args != (1 + num_regs)) || cfun->calls_alloca)
2.28 + {
2.29 ++ emit_insn (gen_blockage ());
2.30 + /* Unwind the stack to just below the saved registers. */
2.31 + emit_insn (gen_addsi3 (stack_pointer_rtx,
2.32 + hard_frame_pointer_rtx,
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/patches/gcc/4.8.2/110-fix-PR-target-58595.patch Thu Apr 17 18:17:12 2014 +0200
3.3 @@ -0,0 +1,101 @@
3.4 +Backport fix for PR target/58595
3.5 +
3.6 +From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
3.7 +Date: Thu, 6 Mar 2014 12:07:07 +0000
3.8 +Subject: [PATCH] PR target/58595 * config/arm/arm.c
3.9 + (arm_tls_symbol_p): Remove. (arm_legitimize_address): Call
3.10 + legitimize_tls_address for any arm_tls_referenced_p expression,
3.11 + handle constant addend. Call it before testing for !TARGET_ARM.
3.12 + (thumb_legitimize_address): Don't handle arm_tls_symbol_p here.
3.13 +
3.14 + * gcc.dg/tls/pr58595.c: New test.
3.15 +
3.16 +
3.17 +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208380 138bc75d-0d04-0410-961f-82ee72b054a4
3.18 +
3.19 +Index: gcc-4.8.2/gcc/config/arm/arm.c
3.20 +===================================================================
3.21 +--- gcc-4.8.2.orig/gcc/config/arm/arm.c
3.22 ++++ gcc-4.8.2/gcc/config/arm/arm.c
3.23 +@@ -230,7 +230,6 @@ static tree arm_gimplify_va_arg_expr (tr
3.24 + static void arm_option_override (void);
3.25 + static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode);
3.26 + static bool arm_cannot_copy_insn_p (rtx);
3.27 +-static bool arm_tls_symbol_p (rtx x);
3.28 + static int arm_issue_rate (void);
3.29 + static void arm_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
3.30 + static bool arm_output_addr_const_extra (FILE *, rtx);
3.31 +@@ -6573,6 +6572,32 @@ legitimize_tls_address (rtx x, rtx reg)
3.32 + rtx
3.33 + arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
3.34 + {
3.35 ++ if (arm_tls_referenced_p (x))
3.36 ++ {
3.37 ++ rtx addend = NULL;
3.38 ++
3.39 ++ if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
3.40 ++ {
3.41 ++ addend = XEXP (XEXP (x, 0), 1);
3.42 ++ x = XEXP (XEXP (x, 0), 0);
3.43 ++ }
3.44 ++
3.45 ++ if (GET_CODE (x) != SYMBOL_REF)
3.46 ++ return x;
3.47 ++
3.48 ++ gcc_assert (SYMBOL_REF_TLS_MODEL (x) != 0);
3.49 ++
3.50 ++ x = legitimize_tls_address (x, NULL_RTX);
3.51 ++
3.52 ++ if (addend)
3.53 ++ {
3.54 ++ x = gen_rtx_PLUS (SImode, x, addend);
3.55 ++ orig_x = x;
3.56 ++ }
3.57 ++ else
3.58 ++ return x;
3.59 ++ }
3.60 ++
3.61 + if (!TARGET_ARM)
3.62 + {
3.63 + /* TODO: legitimize_address for Thumb2. */
3.64 +@@ -6581,9 +6606,6 @@ arm_legitimize_address (rtx x, rtx orig_
3.65 + return thumb_legitimize_address (x, orig_x, mode);
3.66 + }
3.67 +
3.68 +- if (arm_tls_symbol_p (x))
3.69 +- return legitimize_tls_address (x, NULL_RTX);
3.70 +-
3.71 + if (GET_CODE (x) == PLUS)
3.72 + {
3.73 + rtx xop0 = XEXP (x, 0);
3.74 +@@ -6695,9 +6717,6 @@ arm_legitimize_address (rtx x, rtx orig_
3.75 + rtx
3.76 + thumb_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
3.77 + {
3.78 +- if (arm_tls_symbol_p (x))
3.79 +- return legitimize_tls_address (x, NULL_RTX);
3.80 +-
3.81 + if (GET_CODE (x) == PLUS
3.82 + && CONST_INT_P (XEXP (x, 1))
3.83 + && (INTVAL (XEXP (x, 1)) >= 32 * GET_MODE_SIZE (mode)
3.84 +@@ -6988,20 +7007,6 @@ thumb_legitimize_reload_address (rtx *x_
3.85 +
3.86 + /* Test for various thread-local symbols. */
3.87 +
3.88 +-/* Return TRUE if X is a thread-local symbol. */
3.89 +-
3.90 +-static bool
3.91 +-arm_tls_symbol_p (rtx x)
3.92 +-{
3.93 +- if (! TARGET_HAVE_TLS)
3.94 +- return false;
3.95 +-
3.96 +- if (GET_CODE (x) != SYMBOL_REF)
3.97 +- return false;
3.98 +-
3.99 +- return SYMBOL_REF_TLS_MODEL (x) != 0;
3.100 +-}
3.101 +-
3.102 + /* Helper for arm_tls_referenced_p. */
3.103 +
3.104 + static int