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) ...@@ -222,11 +222,16 @@ cgen(Node *n, Node *res)
goto ret; goto ret;
case OMINUS: case OMINUS:
nr = nl; nodconst(&n3, nl->type, 0);
nl = &n1; regalloc(&n2, nl->type, res);
nodconst(nl, nr->type, 0); regalloc(&n1, nl->type, N);
a = optoas(OSUB, nr->type); gmove(&n3, &n2);
goto abop; cgen(nl, &n1);
gins(optoas(OSUB, nl->type), &n1, &n2);
gmove(&n2, res);
regfree(&n1);
regfree(&n2);
goto ret;
// symmetric binary // symmetric binary
case OAND: 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