aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorJames Lyon <jamesly0n@hotmail.com>2013-04-19 18:31:24 +0100
committerJames Lyon <jamesly0n@hotmail.com>2013-04-19 18:33:30 +0100
commit946afd2343b1f129af4014740ee8876fa20b6f64 (patch)
tree6d9c18d0e2d0752bfcf72ed991ac5714cdb35148 /tccgen.c
parent0e17671f7226ffdb78867287d618c8a37ba799fd (diff)
downloadtinycc-946afd2343b1f129af4014740ee8876fa20b6f64.tar.gz
tinycc-946afd2343b1f129af4014740ee8876fa20b6f64.tar.bz2
Fixed problems with XMM1 use on Linux/x86-64.
All tests pass. I think I've caught all the cases assuming only XMM0 is used. I expect that Win64 is horribly broken by this point though, because I haven't altered it to cope with XMM1.
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tccgen.c b/tccgen.c
index f8efb12..f4de9f4 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -626,15 +626,16 @@ ST_FUNC void save_regs(int n)
}
}
-/* move register 's' to 'r', and flush previous value of r to memory
+/* move register 's' (of type 't') to 'r', and flush previous value of r to memory
if needed */
-static void move_reg(int r, int s)
+static void move_reg(int r, int s, int t)
{
SValue sv;
if (r != s) {
save_reg(r);
- sv.type.t = VT_INT;
+ sv.type.t = t;
+ sv.type.ref = NULL;
sv.r = s;
sv.c.ul = 0;
load(r, &sv);
@@ -4271,7 +4272,7 @@ static void expr_cond(void)
if (VT_STRUCT == (vtop->type.t & VT_BTYPE))
gaddrof();
r1 = gv(rc);
- move_reg(r2, r1);
+ move_reg(r2, r1, type.t);
vtop->r = r2;
gsym(tt);
}