aarch64.c (*aarch64_load_symref_appropriately): Check whether the destination of...
authorAndrew Pinski <apinski@cavium.com>
Wed, 18 Feb 2015 04:40:10 +0000 (04:40 +0000)
committerNaveen H.S <naveenh@gcc.gnu.org>
Wed, 18 Feb 2015 04:40:10 +0000 (04:40 +0000)
* config/aarch64/aarch64.c (*aarch64_load_symref_appropriately):
Check whether the destination of SYMBOL_SMALL_TPREL is Pmode.

Co-Authored-By: Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
From-SVN: r220779

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index 3cbcc15956399775f003024efa79a4f646d7fb5c..2c75df60807e03b59f89a18e106f0daca9ba5056 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-18  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.
+
 2015-02-17  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa-visibility.c (function_and_variable_visibility): Only
index 39921a7ae1e3810ecc6d5f0531827d4bc1d99a5c..cba3c1a4d42c7d543e0ed96a7b41fcd9c925f245 100644 (file)
@@ -911,6 +911,10 @@ aarch64_load_symref_appropriately (rtx dest, rtx imm,
     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;