From 13ecc9e00390125437b13b4f977f96a34d682b4a Mon Sep 17 00:00:00 2001 From: Kaz Kojima Date: Tue, 6 Apr 2004 05:58:44 +0000 Subject: [PATCH] sh.c (prepare_move_operands): Use emit_call_insn when the TLS address is generated by a function call. * 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. From-SVN: r80450 --- gcc/ChangeLog | 7 +++++++ gcc/config/sh/sh.c | 4 ++-- gcc/config/sh/sh.md | 10 ++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 110559388af..7cf0c67666b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-04-05 Kaz Kojima + + * 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 * tree.c (reconstruct_complex_type): Use TYPE_READONLY diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 32c8ef99d0f..a790c43a043 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -944,13 +944,13 @@ prepare_move_operands (rtx operands[], enum machine_mode mode) { 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); diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 73cd17d9e5c..a31e8b125c1 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -6863,8 +6863,9 @@ (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)) @@ -6891,8 +6892,9 @@ mov.l\\t1f,r4\\n\\ (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)) -- 2.30.2