diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-08-06 13:08:31 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-15 23:01:30 -0400 |
commit | 2482f4dbbb8a8fdc1a1bc398d5b8ca6f5af1fbd6 (patch) | |
tree | 623f29033d5fee4b948fa19de4013d6a20096cc2 /lisc/isel.c | |
parent | e5983ba1a2174fe7fd004692a427aae5bfc0dc4c (diff) | |
download | roux-2482f4dbbb8a8fdc1a1bc398d5b8ca6f5af1fbd6.tar.gz |
fix two bugs in isel
Diffstat (limited to 'lisc/isel.c')
-rw-r--r-- | lisc/isel.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisc/isel.c b/lisc/isel.c index ea4aa01..8fe7535 100644 --- a/lisc/isel.c +++ b/lisc/isel.c @@ -86,6 +86,7 @@ sel(Ins i, Fn *fn) break; default: if (OCmp <= i.op && i.op <= OCmp1) { + t = -1; r0 = i.arg[0]; c = i.op - OCmp; if (rtype(i.arg[0]) == RCon) { @@ -98,12 +99,12 @@ sel(Ins i, Fn *fn) } else { r0 = i.arg[1]; i.arg[1] = i.arg[0]; - c = CNEG(c); + c = COP(c); } } emit(OXSet+c, i.to, R, R); emit(OXCmp, R, i.arg[1], r0); - if (!req(r0, i.arg[0])) + if (t != -1) emit(OCopy, r0, i.arg[0], R); break; } |