This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, AArch64] Handle SYMBOL_SMALL_TPREL appropriately
- From: "Hurugalawadi, Naveen" <Naveen dot Hurugalawadi at caviumnetworks dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: "Pinski, Andrew" <Andrew dot Pinski at caviumnetworks dot com>
- Date: Mon, 2 Feb 2015 04:51:27 +0000
- Subject: [PATCH, AArch64] Handle SYMBOL_SMALL_TPREL appropriately
- Authentication-results: sourceware.org; auth=none
- Authentication-results: caviumnetworks.com; dkim=none (message not signed) header.d=none;
Hi,
Please find attached the patch that handles the operations on
SYMBOL_SMALL_TPREL appropriately.
It fixes gcc.dg/tls/opt-11.c regression on ilp32.
Please review the patch and let us know if its okay?
Regression tested on aarch64-elf.
Thanks,
Naveen
2015-02-02 Andrew Pinski <apinski@cavium.com>
Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
* config/aarch64/aarch64.c (*aarch64_load_symref_appropriately):
Check whether the destination of SYMBOL_SMALL_TPREL is Pmode.
Index: gcc/config/aarch64/aarch64.c
===================================================================
--- gcc/config/aarch64/aarch64.c (revision 220343)
+++ gcc/config/aarch64/aarch64.c (working copy)
@@ -956,6 +956,10 @@
case SYMBOL_SMALL_TPREL:
{
rtx tp = aarch64_load_tp (NULL);
+
+ if (GET_MODE (dest) != Pmode)
+ tp = gen_lowpart (GET_MODE (dest), tp);
+
emit_insn (gen_tlsle_small (dest, tp, imm));
set_unique_reg_note (get_last_insn (), REG_EQUIV, imm);
return;