]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR rtl-optimization/58066
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jul 2015 07:39:30 +0000 (07:39 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jul 2015 07:39:30 +0000 (07:39 +0000)
* calls.c (expand_call): Precompute register parameters before stack
alignment is performed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225807 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/calls.c

index 327564f58831b3ead15e9062c4baa68e21cc8f0b..6340afe464f8329a164728862aa960d6aa5983e8 100644 (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
index 143e6125bd876b43ac1160667e957f890d763cee..2a297b0dc95aee01f02a2211ed0e4bfbfdd6e89d 100644 (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