]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/44266 (stack frame lacks parameter save area)
authorAlan Modra <amodra@gmail.com>
Wed, 17 Nov 2010 06:01:03 +0000 (16:31 +1030)
committerAlan Modra <amodra@gcc.gnu.org>
Wed, 17 Nov 2010 06:01:03 +0000 (16:31 +1030)
PR target/44266
Backport r159963
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Use
emit_library_call machinery to set up __tls_get_addr calls.

From-SVN: r166856

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index 7ce54a641fe0ddf20b1c7f07398c14c9264382f3..58f9160f01d17a5b30e8317c5c209bfa8894bcc3 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-17  Alan Modra  <amodra@gmail.com>
+
+       PR target/44266
+       * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Use
+       emit_library_call machinery to set up __tls_get_addr calls.
+
 2010-11-16  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR rtl-optimization/46315
index ca3f61f4b0176c2334eb55458099e350a42f1eda..9545d3e3da388b6ce77bd602c61c9362baccb5f6 100644 (file)
@@ -5391,7 +5391,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
     }
   else
     {
-      rtx r3, got, tga, tmp1, tmp2, eqv;
+      rtx r3, got, tga, tmp1, tmp2, call_insn;
 
       /* We currently use relocations like @got@tlsgd for tls, which
         means the linker will handle allocation of tls entries, placing
@@ -5431,6 +5431,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
        {
          r3 = gen_rtx_REG (Pmode, 3);
          tga = rs6000_tls_get_addr ();
+         emit_library_call_value (tga, dest, LCT_CONST, Pmode, 1, r3, Pmode);
 
          if (DEFAULT_ABI == ABI_AIX && TARGET_64BIT)
            insn = gen_tls_gd_aix64 (r3, got, addr, tga, const0_rtx);
@@ -5440,21 +5441,18 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
            insn = gen_tls_gd_sysvsi (r3, got, addr, tga, const0_rtx);
          else
            gcc_unreachable ();
-
-         start_sequence ();
-         insn = emit_call_insn (insn);
-         RTL_CONST_CALL_P (insn) = 1;
-         use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r3);
+         call_insn = last_call_insn ();
+         PATTERN (call_insn) = insn;
          if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic)
-           use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
-         insn = get_insns ();
-         end_sequence ();
-         emit_libcall_block (insn, dest, r3, addr);
+           use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn),
+                    pic_offset_table_rtx);
        }
       else if (model == TLS_MODEL_LOCAL_DYNAMIC)
        {
          r3 = gen_rtx_REG (Pmode, 3);
          tga = rs6000_tls_get_addr ();
+         tmp1 = gen_reg_rtx (Pmode);
+         emit_library_call_value (tga, tmp1, LCT_CONST, Pmode, 1, r3, Pmode);
 
          if (DEFAULT_ABI == ABI_AIX && TARGET_64BIT)
            insn = gen_tls_ld_aix64 (r3, got, tga, const0_rtx);
@@ -5464,19 +5462,12 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
            insn = gen_tls_ld_sysvsi (r3, got, tga, const0_rtx);
          else
            gcc_unreachable ();
-
-         start_sequence ();
-         insn = emit_call_insn (insn);
-         RTL_CONST_CALL_P (insn) = 1;
-         use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r3);
+         call_insn = last_call_insn ();
+         PATTERN (call_insn) = insn;
          if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic)
-           use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
-         insn = get_insns ();
-         end_sequence ();
-         tmp1 = gen_reg_rtx (Pmode);
-         eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
-                               UNSPEC_TLSLD);
-         emit_libcall_block (insn, tmp1, r3, eqv);
+           use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn),
+                    pic_offset_table_rtx);
+
          if (rs6000_tls_size == 16)
            {
              if (TARGET_64BIT)