Commit ac4ee457 by Uros Bizjak Committed by Uros Bizjak

re PR target/58066 (__tls_get_addr is called with misaligned stack on x86-64)

	PR rtl-optimization/58066
	* calls.c (expand_call): Precompute register parameters before stack
	alignment is performed.

From-SVN: r225807
parent 7a708f68
2015-07-15 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/58066
* calls.c (expand_call): Precompute register parameters before stack
alignment is performed.
2015-07-15 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/66838
* postreload.c (reload_cse_move2add): Also process
CALL_INSN_FUNCTION_USAGE when resetting information of
......
......@@ -3144,6 +3144,13 @@ expand_call (tree exp, rtx target, int ignore)
compute_argument_addresses (args, argblock, num_actuals);
/* Precompute all register parameters. It isn't safe to compute
anything once we have started filling any specific hard regs.
TLS symbols sometimes need a call to resolve. Precompute
register parameters before any stack pointer manipulation
to avoid unaligned stack in the called function. */
precompute_register_parameters (num_actuals, args, &reg_parm_seen);
/* Perform stack alignment before the first push (the last arg). */
if (argblock == 0
&& adjusted_args_size.constant > reg_parm_stack_space
......@@ -3184,10 +3191,6 @@ expand_call (tree exp, rtx target, int ignore)
funexp = rtx_for_function_call (fndecl, addr);
/* Precompute all register parameters. It isn't safe to compute anything
once we have started filling any specific hard regs. */
precompute_register_parameters (num_actuals, args, &reg_parm_seen);
if (CALL_EXPR_STATIC_CHAIN (exp))
static_chain_value = expand_normal (CALL_EXPR_STATIC_CHAIN (exp));
else
......
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