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 2bf5d540eba8c7532ce81d5de36ed25781df6881 Author: Uros Bizja ubizjak@gmail.com Date: Mon Jul 13 18:26:05 2015 -0700
Fix PR 58066, __tls_get_addr is called with misaligned stack on x86-64
This is rtl-optimization part of a two-part patch series.
As discussed in the PR, we have to prcompute register parameters before stack alignment is performed, otherwise eventual call to __tls_get_addr can be called with unaligned stack. When compiling the testcase from the PR, anti_adjust_stack is called just before precompute starts expanding function parameters.
The solution is to move precomputation before stack pointer is adjusted.
PR rtl-optimization/58066 * calls.c (expand_call): Precompute register parameters before stack alignment is performed. --- gcc/calls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gcc/calls.c b/gcc/calls.c index 32ea4eb..88d3c4f 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -3115,6 +3115,10 @@ 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. */ + precompute_register_parameters (num_actuals, args, ®_parm_seen); + /* Perform stack alignment before the first push (the last arg). */ if (argblock == 0 && adjusted_args_size.constant > reg_parm_stack_space @@ -3155,10 +3159,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, ®_parm_seen); - if (CALL_EXPR_STATIC_CHAIN (exp)) static_chain_value = expand_normal (CALL_EXPR_STATIC_CHAIN (exp)); else