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
This commit is contained in:
Uros Bizjak 2015-07-15 09:39:30 +02:00 committed by Uros Bizjak
parent 7a708f68bf
commit ac4ee45775
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -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