aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2015-07-15 09:39:30 +0200
committerUros Bizjak <uros@gcc.gnu.org>2015-07-15 09:39:30 +0200
commitac4ee457756c19ef2f0f10d49686de8c30ef9d88 (patch)
tree93404c2111747f460750cfb0b2b6d9d2e7515cf5 /gcc
parent7a708f68bfb52c2986e2ef39bfa40a7bb3fbb51e (diff)
downloadgcc-ac4ee457756c19ef2f0f10d49686de8c30ef9d88.zip
gcc-ac4ee457756c19ef2f0f10d49686de8c30ef9d88.tar.gz
gcc-ac4ee457756c19ef2f0f10d49686de8c30ef9d88.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/calls.c11
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 327564f..6340afe 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
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
* postreload.c (reload_cse_move2add): Also process
CALL_INSN_FUNCTION_USAGE when resetting information of
diff --git a/gcc/calls.c b/gcc/calls.c
index 143e612..2a297b0 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -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