]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/50691 (Incorrect argument evaluation in call with __thread argument)
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Sat, 29 Oct 2011 21:28:57 +0000 (21:28 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sat, 29 Oct 2011 21:28:57 +0000 (21:28 +0000)
PR target/50691
* config/pa/pa.c (emit_move_sequence): Legitimize TLS symbol references.
* config/pa/pa.h (LEGITIMATE_CONSTANT_P): Return false for
TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC symbol references.

From-SVN: r180664

gcc/ChangeLog
gcc/config/pa/pa.c
gcc/config/pa/pa.h

index 68cf82f330661ead389aae9f14c0ca6f6d8a3504..6decb93352db3a393428e818884e1cf5b9480010 100644 (file)
@@ -1,3 +1,10 @@
+2011-10-29  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR target/50691
+       * config/pa/pa.c (emit_move_sequence): Legitimize TLS symbol references.
+       * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Return false for
+       TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC symbol references.
+
 2011-10-23  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/50788
index 545187f1223bb7ec4d85d5358f1cad723557375e..3e5084c3d9348234613a411d217c17a936389872 100644 (file)
@@ -1686,6 +1686,11 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
   /* Handle the most common case: storing into a register.  */
   else if (register_operand (operand0, mode))
     {
+      /* Legitimize TLS symbol references.  This happens for references
+        that aren't a legitimate constant.  */
+      if (PA_SYMBOL_REF_TLS_P (operand1))
+       operand1 = legitimize_tls_address (operand1);
+
       if (register_operand (operand1, mode)
          || (GET_CODE (operand1) == CONST_INT
              && cint_ok_for_move (INTVAL (operand1)))
index 4d63c6fa18736260bfdf46c09fcde5fe9a42b5bb..f5432ddd9718e6f55e4d1552f68dd8b85913b931 100644 (file)
@@ -891,6 +891,9 @@ extern int may_call_alloca;
    && (NEW_HP_ASSEMBLER                                                \
        || TARGET_GAS                                           \
        || GET_CODE (X) != LABEL_REF)                           \
+   && (!PA_SYMBOL_REF_TLS_P (X)                                        \
+       || (SYMBOL_REF_TLS_MODEL (X) != TLS_MODEL_GLOBAL_DYNAMIC                \
+          && SYMBOL_REF_TLS_MODEL (X) != TLS_MODEL_LOCAL_DYNAMIC))     \
    && (!TARGET_64BIT                                           \
        || GET_CODE (X) != CONST_DOUBLE)                                \
    && (!TARGET_64BIT                                           \