From 6058b2fa2cc5799e442cc8c7a02bff0b170b6025 Mon Sep 17 00:00:00 2001 From: Kaz Kojima Date: Fri, 21 Oct 2005 14:09:31 +0000 Subject: [PATCH] sh.c (prepare_move_operands): Handle the address constant which is a tls symbolic address plus a constant. * config/sh/sh.c (prepare_move_operands): Handle the address constant which is a tls symbolic address plus a constant. From-SVN: r105736 --- gcc/ChangeLog | 5 +++++ gcc/config/sh/sh.c | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6ff0307d0ec..d7a6e593316 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-10-21 Kaz Kojima + + * config/sh/sh.c (prepare_move_operands): Handle the address + constant which is a tls symbolic address plus a constant. + 2005-10-21 Andrew Pinski PR driver/24473 diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 3e0caf15f99..e11d557d3c1 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -1238,11 +1238,21 @@ prepare_move_operands (rtx operands[], enum machine_mode mode) if (mode == Pmode || mode == ptr_mode) { - rtx op0, op1; + rtx op0, op1, opc; enum tls_model tls_kind; op0 = operands[0]; op1 = operands[1]; + if (GET_CODE (op1) == CONST + && GET_CODE (XEXP (op1, 0)) == PLUS + && tls_symbolic_operand (XEXP (XEXP (op1, 0), 0), Pmode)) + { + opc = XEXP (XEXP (op1, 0), 1); + op1 = XEXP (XEXP (op1, 0), 0); + } + else + opc = NULL_RTX; + if ((tls_kind = tls_symbolic_operand (op1, Pmode))) { rtx tga_op1, tga_ret, tmp, tmp2; @@ -1308,6 +1318,8 @@ prepare_move_operands (rtx operands[], enum machine_mode mode) default: gcc_unreachable (); } + if (opc) + emit_insn (gen_addsi3 (op1, op1, force_reg (SImode, opc))); operands[1] = op1; } }