]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sparc.c (tls_call_delay): Fix oversight.
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 9 Feb 2006 12:27:12 +0000 (12:27 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 9 Feb 2006 12:27:12 +0000 (12:27 +0000)
* config/sparc/sparc.c (tls_call_delay): Fix oversight.

From-SVN: r110793

gcc/ChangeLog
gcc/config/sparc/sparc.c

index f7bffe4faf6701862d550f1ff0c7a3242fdca537..57ac1f722ff8fd123cf0a73b47ac96c63199c527 100644 (file)
@@ -1,3 +1,9 @@
+2006-02-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * config/sparc/sparc.c (tls_call_delay): Fix oversight.
+
+2006-02-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
        PR target/26109
        * pa.c (attr_length_indirect_call): Don't return length 8 for distances
        >= 240000 when generating code for SOM runtime.
index 0b07e46f6ef8cc6f79d1d08dff8ee7bc0fd09015..86524cc3732385613b20174f235293307809c4a1 100644 (file)
@@ -2946,26 +2946,34 @@ eligible_for_epilogue_delay (rtx trial, int slot)
 int
 tls_call_delay (rtx trial)
 {
-  rtx pat, unspec;
+  rtx pat;
 
   /* Binutils allows
-     call __tls_get_addr, %tgd_call (foo)
-      add %l7, %o0, %o0, %tgd_add (foo)
+       call __tls_get_addr, %tgd_call (foo)
+        add %l7, %o0, %o0, %tgd_add (foo)
      while Sun as/ld does not.  */
   if (TARGET_GNU_TLS || !TARGET_TLS)
     return 1;
 
   pat = PATTERN (trial);
-  if (GET_CODE (pat) != SET || GET_CODE (SET_DEST (pat)) != PLUS)
-    return 1;
 
-  unspec = XEXP (SET_DEST (pat), 1);
-  if (GET_CODE (unspec) != UNSPEC
-      || (XINT (unspec, 1) != UNSPEC_TLSGD
-         && XINT (unspec, 1) != UNSPEC_TLSLDM))
-    return 1;
+  /* We must reject tgd_add{32|64}, i.e.
+       (set (reg) (plus (reg) (unspec [(reg) (symbol_ref)] UNSPEC_TLSGD)))
+     and tldm_add{32|64}, i.e.
+       (set (reg) (plus (reg) (unspec [(reg) (symbol_ref)] UNSPEC_TLSLDM)))
+     for Sun as/ld.  */
+  if (GET_CODE (pat) == SET
+      && GET_CODE (SET_SRC (pat)) == PLUS)
+    {
+      rtx unspec = XEXP (SET_SRC (pat), 1);
 
-  return 0;
+      if (GET_CODE (unspec) == UNSPEC
+         && (XINT (unspec, 1) == UNSPEC_TLSGD
+             || XINT (unspec, 1) == UNSPEC_TLSLDM))
+       return 0;
+    }
+
+  return 1;
 }
 
 /* Return nonzero if TRIAL can go into the sibling call