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 <apin...@cavium.com>
Naveen H.S <naveen.hurugalaw...@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;