aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/sparc/hipe_sparc_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/sparc/hipe_sparc_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/sparc/hipe_sparc_registers.erl')
-rw-r--r--lib/hipe/sparc/hipe_sparc_registers.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/hipe/sparc/hipe_sparc_registers.erl b/lib/hipe/sparc/hipe_sparc_registers.erl
index 884215702b..6681a10070 100644
--- a/lib/hipe/sparc/hipe_sparc_registers.erl
+++ b/lib/hipe/sparc/hipe_sparc_registers.erl
@@ -86,6 +86,8 @@
-define(I7, 31).
-define(LAST_PRECOLOURED,31). % must handle both GRP and FPR ranges
+-define(RA, ?O7).
+
-define(ARG0, ?O1).
-define(ARG1, ?O2).
-define(ARG2, ?O3).
@@ -174,7 +176,7 @@ stack_pointer() -> ?STACK_POINTER.
proc_pointer() -> ?PROC_POINTER.
-return_address() -> ?O7.
+return_address() -> ?RA.
g0() -> ?G0.
@@ -283,7 +285,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}
+ ,{?RA,tagged},{?RA,untagged}
+ ].
live_at_return() ->
[{?HEAP_POINTER,untagged},