re PR target/58066 (__tls_get_addr is called with misaligned stack on x86-64)
authorUros Bizjak <ubizjak@gmail.com>
Wed, 15 Jul 2015 13:42:07 +0000 (15:42 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 15 Jul 2015 13:42:07 +0000 (15:42 +0200)
PR target/58066
* config/i386/i386.md (*tls_global_dynamic_64_<mode>): Depend on SP_REG.
(*tls_local_dynamic_base_64_<mode>): Ditto.
(*tls_local_dynamic_base_64_largepic): Ditto.
(tls_global_dynamic_64_<mode>): Update expander pattern.
(tls_local_dynamic_base_64_<mode>): Ditto.

From-SVN: r225829

gcc/ChangeLog
gcc/config/i386/i386.md

index 675082087351b3b0cb718f2f9395d70bfa0461de..244e81e82f03fb3328c5dba84c067812c9abc6aa 100644 (file)
@@ -1,3 +1,12 @@
+2015-07-15  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/58066
+       * config/i386/i386.md (*tls_global_dynamic_64_<mode>): Depend on SP_REG.
+       (*tls_local_dynamic_base_64_<mode>): Ditto.
+       (*tls_local_dynamic_base_64_largepic): Ditto.
+       (tls_global_dynamic_64_<mode>): Update expander pattern.
+       (tls_local_dynamic_base_64_<mode>): Ditto.
+
 2015-07-15  Richard Biener  <rguenther@suse.de>
 
        * fold-const.c (fold_binary_loc): Move bool_var != 0 -> bool_var
index 354532a6f0e0685736c5f4357699fb7f1c67f9bf..b7b795ed26718b1c2c9910df1995719fb51ca16a 100644 (file)
        (call:P
         (mem:QI (match_operand 2 "constant_call_address_operand" "Bz"))
         (match_operand 3)))
-   (unspec:P [(match_operand 1 "tls_symbolic_operand")]
+   (unspec:P [(match_operand 1 "tls_symbolic_operand")
+             (reg:P SP_REG)]
             UNSPEC_TLS_GD)]
   "TARGET_64BIT"
 {
         (mem:QI (plus:DI (match_operand:DI 2 "register_operand" "b")
                          (match_operand:DI 3 "immediate_operand" "i")))
         (match_operand 4)))
-   (unspec:DI [(match_operand 1 "tls_symbolic_operand")]
-            UNSPEC_TLS_GD)]
+   (unspec:DI [(match_operand 1 "tls_symbolic_operand")
+              (reg:DI SP_REG)]
+             UNSPEC_TLS_GD)]
   "TARGET_64BIT && ix86_cmodel == CM_LARGE_PIC && !TARGET_PECOFF
    && GET_CODE (operands[3]) == CONST
    && GET_CODE (XEXP (operands[3], 0)) == UNSPEC
          (call:P
           (mem:QI (match_operand 2))
           (const_int 0)))
-     (unspec:P [(match_operand 1 "tls_symbolic_operand")]
+     (unspec:P [(match_operand 1 "tls_symbolic_operand")
+               (reg:P SP_REG)]
               UNSPEC_TLS_GD)])]
   "TARGET_64BIT"
   "ix86_tls_descriptor_calls_expanded_in_cfun = true;")
        (call:P
         (mem:QI (match_operand 1 "constant_call_address_operand" "Bz"))
         (match_operand 2)))
-   (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)]
+   (unspec:P [(reg:P SP_REG)] UNSPEC_TLS_LD_BASE)]
   "TARGET_64BIT"
 {
   output_asm_insn
         (mem:QI (plus:DI (match_operand:DI 1 "register_operand" "b")
                          (match_operand:DI 2 "immediate_operand" "i")))
         (match_operand 3)))
-   (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)]
+   (unspec:DI [(reg:DI SP_REG)] UNSPEC_TLS_LD_BASE)]
   "TARGET_64BIT && ix86_cmodel == CM_LARGE_PIC && !TARGET_PECOFF
    && GET_CODE (operands[2]) == CONST
    && GET_CODE (XEXP (operands[2], 0)) == UNSPEC
           (call:P
            (mem:QI (match_operand 1))
            (const_int 0)))
-      (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)])]
+      (unspec:P [(reg:P SP_REG)] UNSPEC_TLS_LD_BASE)])]
   "TARGET_64BIT"
   "ix86_tls_descriptor_calls_expanded_in_cfun = true;")