This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, AArch64] Handle SYMBOL_SMALL_TPREL appropriately


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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]