Commit a9e03ae5 authored by Kai Backman's avatar Kai Backman

fix broken code produced for ominus

go/test: passes 89% (308/345)

R=rsc
APPROVED=rsc
DELTA=10  (5 added, 0 deleted, 5 changed)
OCL=36005
CL=36021
parent 03bbfe67
......@@ -222,11 +222,16 @@ cgen(Node *n, Node *res)
goto ret;
case OMINUS:
nr = nl;
nl = &n1;
nodconst(nl, nr->type, 0);
a = optoas(OSUB, nr->type);
goto abop;
nodconst(&n3, nl->type, 0);
regalloc(&n2, nl->type, res);
regalloc(&n1, nl->type, N);
gmove(&n3, &n2);
cgen(nl, &n1);
gins(optoas(OSUB, nl->type), &n1, &n2);
gmove(&n2, res);
regfree(&n1);
regfree(&n2);
goto ret;
// symmetric binary
case OAND:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment