]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
calls.c (expand_call): Wrap precompute_register_parameters with NO_DEFER_POP/OK_DEFER...
authorUros Bizjak <uros@gcc.gnu.org>
Wed, 9 Dec 2015 18:50:19 +0000 (19:50 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 9 Dec 2015 18:50:19 +0000 (19:50 +0100)
* 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

gcc/calls.c

index 25f4f101402f576daa8acbc3044a6ecd3b27039d..8ada78fba7f014f04d2c907d56a0ec192c485c8b 100644 (file)
@@ -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, &reg_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, &reg_parm_seen);
-
       if (CALL_EXPR_STATIC_CHAIN (exp))
        static_chain_value = expand_normal (CALL_EXPR_STATIC_CHAIN (exp));
       else