mirror of
git://c9x.me/qbe.git
synced 2026-04-05 18:09:47 +00:00
forbid two memory operands for comparisons
This commit is contained in:
parent
1721fe4313
commit
4b0a865fee
10
lisc/spill.c
10
lisc/spill.c
@ -362,6 +362,16 @@ spill(Fn *fn)
|
||||
}
|
||||
w = (Bits){{0}};
|
||||
setloc(&i->arg[0], &v, &w);
|
||||
if (i->op == OXCmpw || i->op == OXCmpl)
|
||||
if (rtype(i->arg[0]) == RSlot) {
|
||||
/* <arch>
|
||||
* we make sure that comparisons
|
||||
* do not get their two operands
|
||||
* in memory slots
|
||||
*/
|
||||
assert(rtype(i->arg[1]) == RTmp);
|
||||
BSET(w, i->arg[1].val);
|
||||
}
|
||||
setloc(&i->arg[1], &v, &w);
|
||||
if (s)
|
||||
emit(OStore, R, i->to, SLOT(s));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user