+2004-04-05 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.c (prepare_move_operands): Use emit_call_insn
+ when the TLS address is generated by a function call.
+ * config/sh/sh.md (tls_global_dynamic): Use a call expression.
+ (tls_local_dynamic): Likewise.
+
2004-04-05 Andrew Pinski <pinskia@physics.uc.edu>
* tree.c (reconstruct_complex_type): Use TYPE_READONLY
{
case TLS_MODEL_GLOBAL_DYNAMIC:
tga_ret = gen_rtx_REG (Pmode, R0_REG);
- emit_insn (gen_tls_global_dynamic (tga_ret, op1));
+ emit_call_insn (gen_tls_global_dynamic (tga_ret, op1));
op1 = tga_ret;
break;
case TLS_MODEL_LOCAL_DYNAMIC:
tga_ret = gen_rtx_REG (Pmode, R0_REG);
- emit_insn (gen_tls_local_dynamic (tga_ret, op1));
+ emit_call_insn (gen_tls_local_dynamic (tga_ret, op1));
tmp = gen_reg_rtx (Pmode);
emit_move_insn (tmp, tga_ret);
(define_insn "tls_global_dynamic"
[(set (match_operand:SI 0 "register_operand" "=&z")
- (unspec:SI [(match_operand:SI 1 "" "")]
- UNSPEC_TLSGD))
+ (call (unspec:SI [(match_operand:SI 1 "" "")]
+ UNSPEC_TLSGD)
+ (const_int 0)))
(use (reg:PSI FPSCR_REG))
(use (reg:SI PIC_REG))
(clobber (reg:SI PR_REG))
(define_insn "tls_local_dynamic"
[(set (match_operand:SI 0 "register_operand" "=&z")
- (unspec:SI [(match_operand:SI 1 "" "")]
- UNSPEC_TLSLDM))
+ (call (unspec:SI [(match_operand:SI 1 "" "")]
+ UNSPEC_TLSLDM)
+ (const_int 0)))
(use (reg:PSI FPSCR_REG))
(use (reg:SI PIC_REG))
(clobber (reg:SI PR_REG))