Commit 31ebc801 by Alexandre Oliva Committed by Alexandre Oliva

i386.c (legitimate_tls_address): Add tp after DTPOFF.

* config/i386/i386.c (legitimate_tls_address)
<TARGET_GNU2_TLS>: Add tp after DTPOFF.
* config/i386/i386.md (*tls_dynamic_gnu2_combine_32): Adjust.
(*tls_dynamic_gnu2_combine_64): Likewise.

From-SVN: r114741
parent 4dc3fbb0
2006-06-17 Alexandre Oliva <aoliva@redhat.com>
* config/i386/i386.c (legitimate_tls_address)
<TARGET_GNU2_TLS>: Add tp after DTPOFF.
* config/i386/i386.md (*tls_dynamic_gnu2_combine_32): Adjust.
(*tls_dynamic_gnu2_combine_64): Likewise.
2006-06-16 Richard Guenther <rguenther@suse.de> 2006-06-16 Richard Guenther <rguenther@suse.de>
PR middle-end/27116 PR middle-end/27116
......
...@@ -6750,15 +6750,22 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov) ...@@ -6750,15 +6750,22 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov)
{ {
rtx x = ix86_tls_module_base (); rtx x = ix86_tls_module_base ();
base = force_reg (Pmode, gen_rtx_PLUS (Pmode, tp, base)); set_unique_reg_note (get_last_insn (), REG_EQUIV,
gen_rtx_MINUS (Pmode, x, tp));
set_unique_reg_note (get_last_insn (), REG_EQUIV, x);
} }
off = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), UNSPEC_DTPOFF); off = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), UNSPEC_DTPOFF);
off = gen_rtx_CONST (Pmode, off); off = gen_rtx_CONST (Pmode, off);
dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, base, off)); dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, base, off));
if (TARGET_GNU2_TLS)
{
dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, dest, tp));
set_unique_reg_note (get_last_insn (), REG_EQUIV, x);
}
break; break;
case TLS_MODEL_INITIAL_EXEC: case TLS_MODEL_INITIAL_EXEC:
......
...@@ -14434,12 +14434,11 @@ ...@@ -14434,12 +14434,11 @@
(define_insn_and_split "*tls_dynamic_gnu2_combine_32" (define_insn_and_split "*tls_dynamic_gnu2_combine_32"
[(set (match_operand:SI 0 "register_operand" "=&a") [(set (match_operand:SI 0 "register_operand" "=&a")
(plus:SI (plus:SI
(plus:SI (match_operand:SI 3 "tp_or_register_operand" "ir") (unspec:SI [(match_operand:SI 3 "tls_modbase_operand" "")
(unspec:SI [(match_operand:SI 4 "tls_modbase_operand" "") (match_operand:SI 4 "" "")
(match_operand:SI 5 "" "") (match_operand:SI 2 "register_operand" "b")
(match_operand:SI 2 "register_operand" "b") (reg:SI SP_REG)]
(reg:SI SP_REG)] UNSPEC_TLSDESC)
UNSPEC_TLSDESC))
(const:SI (unspec:SI (const:SI (unspec:SI
[(match_operand:SI 1 "tls_symbolic_operand" "")] [(match_operand:SI 1 "tls_symbolic_operand" "")]
UNSPEC_DTPOFF)))) UNSPEC_DTPOFF))))
...@@ -14447,11 +14446,7 @@ ...@@ -14447,11 +14446,7 @@
"!TARGET_64BIT && TARGET_GNU2_TLS" "!TARGET_64BIT && TARGET_GNU2_TLS"
"#" "#"
"" ""
[(parallel [(set (match_dup 0) (match_dup 5))]
[(set (match_dup 0)
(plus:SI (match_dup 3)
(match_dup 5)))
(clobber (reg:CC FLAGS_REG))])]
{ {
operands[5] = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode); operands[5] = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode);
emit_insn (gen_tls_dynamic_gnu2_32 (operands[5], operands[1], operands[2])); emit_insn (gen_tls_dynamic_gnu2_32 (operands[5], operands[1], operands[2]));
...@@ -14499,11 +14494,10 @@ ...@@ -14499,11 +14494,10 @@
(define_insn_and_split "*tls_dynamic_gnu2_combine_64" (define_insn_and_split "*tls_dynamic_gnu2_combine_64"
[(set (match_operand:DI 0 "register_operand" "=&a") [(set (match_operand:DI 0 "register_operand" "=&a")
(plus:DI (plus:DI
(plus:DI (match_operand:DI 2 "tp_or_register_operand" "ir") (unspec:DI [(match_operand:DI 2 "tls_modbase_operand" "")
(unspec:DI [(match_operand:DI 3 "tls_modbase_operand" "") (match_operand:DI 3 "" "")
(match_operand:DI 4 "" "") (reg:DI SP_REG)]
(reg:DI SP_REG)] UNSPEC_TLSDESC)
UNSPEC_TLSDESC))
(const:DI (unspec:DI (const:DI (unspec:DI
[(match_operand:DI 1 "tls_symbolic_operand" "")] [(match_operand:DI 1 "tls_symbolic_operand" "")]
UNSPEC_DTPOFF)))) UNSPEC_DTPOFF))))
...@@ -14511,11 +14505,7 @@ ...@@ -14511,11 +14505,7 @@
"TARGET_64BIT && TARGET_GNU2_TLS" "TARGET_64BIT && TARGET_GNU2_TLS"
"#" "#"
"" ""
[(parallel [(set (match_dup 0) (match_dup 4))]
[(set (match_dup 0)
(plus:DI (match_dup 2)
(match_dup 4)))
(clobber (reg:CC FLAGS_REG))])]
{ {
operands[4] = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode); operands[4] = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode);
emit_insn (gen_tls_dynamic_gnu2_64 (operands[4], operands[1])); emit_insn (gen_tls_dynamic_gnu2_64 (operands[4], operands[1]));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment