aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/arm/hipe_arm_registers.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-04-12 18:48:27 +0200
committerMagnus Lång <[email protected]>2016-08-22 15:25:16 +0200
commitb7c2af9863a5410ce0be9c2995ea49746b207877 (patch)
treea55fd09cb18838b3b2a289ae4040f0d59c93ea03 /lib/hipe/arm/hipe_arm_registers.erl
parent230d8cec7465d2b75d0b78c2bcaa76ccbd7f6a29 (diff)
downloadotp-b7c2af9863a5410ce0be9c2995ea49746b207877.tar.gz
otp-b7c2af9863a5410ce0be9c2995ea49746b207877.tar.bz2
otp-b7c2af9863a5410ce0be9c2995ea49746b207877.zip
hipe: Fix tailcall stackarg clobber bug
Since the link register/return address is restored before stack arguments are stored to the frame, we must not use it to store a stack argument. We do that by adding it to the registers clobbered by pseudo_tailcall_prepare.
Diffstat (limited to 'lib/hipe/arm/hipe_arm_registers.erl')
-rw-r--r--lib/hipe/arm/hipe_arm_registers.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/hipe/arm/hipe_arm_registers.erl b/lib/hipe/arm/hipe_arm_registers.erl
index 24cd929d41..dcf039676b 100644
--- a/lib/hipe/arm/hipe_arm_registers.erl
+++ b/lib/hipe/arm/hipe_arm_registers.erl
@@ -67,6 +67,8 @@
-define(R15, 15).
-define(LAST_PRECOLOURED, 15). % must handle both GPR and FPR ranges
+-define(LR, ?R14).
+
-define(ARG0, ?R1).
-define(ARG1, ?R2).
-define(ARG2, ?R3).
@@ -114,7 +116,7 @@ stack_pointer() -> ?STACK_POINTER.
proc_pointer() -> ?PROC_POINTER.
-lr() -> ?R14.
+lr() -> ?LR.
pc() -> ?R15.
@@ -198,7 +200,9 @@ call_clobbered() -> % does the RA strip the type or not?
].
tailcall_clobbered() -> % tailcall crapola needs one temp
- [{?TEMP1,tagged},{?TEMP1,untagged}].
+ [{?TEMP1,tagged},{?TEMP1,untagged}
+ ,{?LR,tagged},{?LR,untagged}
+ ].
live_at_return() ->
[%%{?LR,untagged},