This is an automated email from the git hooks/post-receive script.
unknown user pushed a commit to branch hjl/pr58066/gcc-5-branch in repository gcc.
commit b317826601be8c4f981cba2d40635be2d9e8dd2c Author: H.J. Lu hjl.tools@gmail.com Date: Sat Jul 11 16:35:07 2015 -0700
Align stack before calling __tls_get_addr --- gcc/config/i386/i386.c | 15 +++++++++++++++ gcc/config/i386/i386.md | 12 +++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7c28a55..e01c075 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -14046,6 +14046,13 @@ legitimize_tls_address (rtx x, enum tls_model model, bool [...] && model == TLS_MODEL_LOCAL_DYNAMIC) model = TLS_MODEL_GLOBAL_DYNAMIC;
+ int preferred_stack_alignment + = ix86_preferred_stack_boundary / BITS_PER_UNIT; + int stack_adjustment = (((stack_pointer_delta + % preferred_stack_alignment) + - preferred_stack_alignment) + % preferred_stack_alignment); + switch (model) { case TLS_MODEL_GLOBAL_DYNAMIC: @@ -14087,8 +14094,12 @@ legitimize_tls_address (rtx x, enum tls_model model, bool [...] rtx_insn *insns;
start_sequence (); + if (stack_adjustment) + adjust_stack (GEN_INT (stack_adjustment)); emit_call_insn (ix86_gen_tls_global_dynamic_64 (rax, x, caddr)); + if (stack_adjustment) + anti_adjust_stack (GEN_INT (stack_adjustment)); insns = get_insns (); end_sequence ();
@@ -14141,8 +14152,12 @@ legitimize_tls_address (rtx x, enum tls_model model, bool [...] rtx eqv;
start_sequence (); + if (stack_adjustment) + adjust_stack (GEN_INT (stack_adjustment)); emit_call_insn (ix86_gen_tls_local_dynamic_base_64 (rax, caddr)); + if (stack_adjustment) + anti_adjust_stack (GEN_INT (stack_adjustment)); insns = get_insns (); end_sequence ();
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 6b6f44c..85db119 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -13333,7 +13333,9 @@ (call:P (mem:QI (match_operand 1 "constant_call_address_operand" "Bz")) (match_operand 2))) - (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)] + (unspec:P [(const_int 0) + (reg:P SP_REG)] + UNSPEC_TLS_LD_BASE)] "TARGET_64BIT" { output_asm_insn @@ -13351,7 +13353,9 @@ (mem:QI (plus:DI (match_operand:DI 1 "register_operand" "b") (match_operand:DI 2 "immediate_operand" "i"))) (match_operand 3))) - (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)] + (unspec:DI [(const_int 0) + (reg:DI SP_REG)] + UNSPEC_TLS_LD_BASE)] "TARGET_64BIT && ix86_cmodel == CM_LARGE_PIC && !TARGET_PECOFF && GET_CODE (operands[2]) == CONST && GET_CODE (XEXP (operands[2], 0)) == UNSPEC @@ -13372,7 +13376,9 @@ (call:P (mem:QI (match_operand 1)) (const_int 0))) - (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)])] + (unspec:P [(const_int 0) + (reg:P SP_REG)] + UNSPEC_TLS_LD_BASE)])] "TARGET_64BIT" "ix86_tls_descriptor_calls_expanded_in_cfun = true;")