summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-09 12:22:09 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-09 12:22:09 +0000
commit442a6b56f6ae1415a32d114655011d769d79ffd0 (patch)
tree12ac07d059bcf7fac72d3afa6eaa963996ebe2c8 /gcc/config
parentcf6b103ecba3ec845e82cac95ce2693954438eec (diff)
downloadgcc-442a6b56f6ae1415a32d114655011d769d79ffd0.tar.gz
* config/sparc/sparc.c (tls_call_delay): Fix oversight.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110790 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/sparc/sparc.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 20026413800..b5781ac65d7 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -2416,26 +2416,34 @@ empty_delay_slot (rtx insn)
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, an insn, can be combined with a 'restore'