diff options
Diffstat (limited to 'contrib/gcc/config/sparc/sparc.c')
-rw-r--r-- | contrib/gcc/config/sparc/sparc.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/contrib/gcc/config/sparc/sparc.c b/contrib/gcc/config/sparc/sparc.c index 0b07e46..86524cc 100644 --- a/contrib/gcc/config/sparc/sparc.c +++ b/contrib/gcc/config/sparc/sparc.c @@ -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 |