mirror of
https://github.com/golang/go
synced 2024-11-19 15:54:46 -07:00
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
This commit is contained in:
parent
03bbfe6724
commit
a9e03ae52a
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user