diff options
author | Alan Modra <amodra@gmail.com> | 2010-05-28 18:27:16 +0930 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2010-05-28 18:27:16 +0930 |
commit | 1cb980a29c89489779ddd2fb3fd2566bbbbfb1a6 (patch) | |
tree | f1fa777bac3ab4f742f22a94c3670192f7af8847 | |
parent | b247e88a784d604835b026339919d7d8cb59ca56 (diff) | |
download | gcc-1cb980a29c89489779ddd2fb3fd2566bbbbfb1a6.zip gcc-1cb980a29c89489779ddd2fb3fd2566bbbbfb1a6.tar.gz gcc-1cb980a29c89489779ddd2fb3fd2566bbbbfb1a6.tar.bz2 |
re PR target/44266 (stack frame lacks parameter save area)
PR target/44266
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Use
emit_library_call machinery to set up __tls_get_addr calls.
From-SVN: r159963
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 35 |
2 files changed, 19 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26a98ff..268e0ca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-05-28 Alan Modra <amodra@gmail.com> + + PR target/44266 + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Use + emit_library_call machinery to set up __tls_get_addr calls. + 2010-05-28 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * config/s390/s390.md (movqi): Fix typo ('*' -> '#'). diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index b1cc4c7..58b6c44 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -5397,7 +5397,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) } else { - rtx r3, got, tga, tmp1, tmp2, eqv; + rtx r3, got, tga, tmp1, tmp2, call_insn; /* We currently use relocations like @got@tlsgd for tls, which means the linker will handle allocation of tls entries, placing @@ -5441,6 +5441,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) { r3 = gen_rtx_REG (Pmode, 3); tga = rs6000_tls_get_addr (); + emit_library_call_value (tga, dest, LCT_CONST, Pmode, 1, r3, Pmode); if (DEFAULT_ABI == ABI_AIX && TARGET_64BIT) insn = gen_tls_gd_aix64 (r3, got, addr, tga, const0_rtx); @@ -5450,21 +5451,18 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) insn = gen_tls_gd_sysvsi (r3, got, addr, tga, const0_rtx); else gcc_unreachable (); - - start_sequence (); - insn = emit_call_insn (insn); - RTL_CONST_CALL_P (insn) = 1; - use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r3); + call_insn = last_call_insn (); + PATTERN (call_insn) = insn; if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic) - use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); - insn = get_insns (); - end_sequence (); - emit_libcall_block (insn, dest, r3, addr); + use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), + pic_offset_table_rtx); } else if (model == TLS_MODEL_LOCAL_DYNAMIC) { r3 = gen_rtx_REG (Pmode, 3); tga = rs6000_tls_get_addr (); + tmp1 = gen_reg_rtx (Pmode); + emit_library_call_value (tga, tmp1, LCT_CONST, Pmode, 1, r3, Pmode); if (DEFAULT_ABI == ABI_AIX && TARGET_64BIT) insn = gen_tls_ld_aix64 (r3, got, tga, const0_rtx); @@ -5474,19 +5472,12 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) insn = gen_tls_ld_sysvsi (r3, got, tga, const0_rtx); else gcc_unreachable (); - - start_sequence (); - insn = emit_call_insn (insn); - RTL_CONST_CALL_P (insn) = 1; - use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r3); + call_insn = last_call_insn (); + PATTERN (call_insn) = insn; if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic) - use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); - insn = get_insns (); - end_sequence (); - tmp1 = gen_reg_rtx (Pmode); - eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx), - UNSPEC_TLSLD); - emit_libcall_block (insn, tmp1, r3, eqv); + use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), + pic_offset_table_rtx); + if (rs6000_tls_size == 16) { if (TARGET_64BIT) |