From: Uros Bizjak Date: Wed, 9 Dec 2015 18:50:19 +0000 (+0100) Subject: calls.c (expand_call): Wrap precompute_register_parameters with NO_DEFER_POP/OK_DEFER... X-Git-Tag: releases/gcc-4.9.4~460 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0383841a363a854d72d192318f8c9bf4aef1855d;p=thirdparty%2Fgcc.git calls.c (expand_call): Wrap precompute_register_parameters with NO_DEFER_POP/OK_DEFER_POP to prevent... * calls.c (expand_call): Wrap precompute_register_parameters with NO_DEFER_POP/OK_DEFER_POP to prevent deferred pops. * calls.c (expand_call): Precompute register parameters before stack alignment is performed. From-SVN: r231469 --- diff --git a/gcc/calls.c b/gcc/calls.c index 25f4f101402f..8ada78fba7f0 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2952,6 +2952,19 @@ expand_call (tree exp, rtx target, int ignore) compute_argument_addresses (args, argblock, num_actuals); + /* Stack is properly aligned, pops can't safely be deferred during + the evaluation of the arguments. */ + NO_DEFER_POP; + + /* 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, ®_parm_seen); + + OK_DEFER_POP; + /* If we push args individually in reverse order, perform stack alignment before the first push (the last arg). */ if (PUSH_ARGS_REVERSED && argblock == 0 @@ -3019,10 +3032,6 @@ expand_call (tree exp, rtx target, int ignore) } } - /* 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