aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-10-03 12:27:50 +0200
committergrischka <grischka>2016-10-03 12:33:41 +0200
commit5805b07218aef3c1049b5db9d89841d383ee917d (patch)
tree846727d417b859d959bbee0cfa697c87d34fbdb9 /tccgen.c
parent78f1c10e0f10770880d50d917910adfdedd646a2 (diff)
downloadtinycc-5805b07218aef3c1049b5db9d89841d383ee917d.tar.gz
tinycc-5805b07218aef3c1049b5db9d89841d383ee917d.tar.bz2
Alternative fix for "Incorrect function call code on ARMv6"
"make test" crashes without that "save_regs()". This partially reverts commit 49d3118621a68f6583228f123efd16f0f803d908. Found another solution: In a 2nd pass Just look if any of the argument registers has been saved again, and restore if so.
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tccgen.c b/tccgen.c
index d55ee39..56be31b 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -861,6 +861,11 @@ ST_FUNC int gv(int rc)
#endif
if (r >= VT_CONST || /* XXX: test to VT_CONST incorrect ? */
(vtop->r & VT_LVAL)) {
+ /* We do not want to modifier the long long
+ pointer here, so the safest (and less
+ efficient) is to save all the other registers
+ in the stack. XXX: totally inefficient. */
+ save_regs(1);
/* load from memory */
vtop->type.t = load_type;
load(r, vtop);