Commit fd922c87 authored by Ken Thompson's avatar Ken Thompson

shift bug

R=r
OCL=18166
CL=18166
parent c1198b9b
......@@ -1047,13 +1047,16 @@ cgen_shift(int op, Node *nl, Node *nr, Node *res)
regalloc(&n1, nr->type, &n1);
// clean out the CL register
if(rcl && !samereg(res, &n1)) {
if(rcl) {
regalloc(&n2, types[TINT64], N);
gins(AMOVQ, &n1, &n2);
regfree(&n1);
reg[D_CX] = 0;
cgen_shift(op, nl, nr, res);
if(samereg(res, &n1))
cgen_shift(op, nl, nr, &n2);
else
cgen_shift(op, nl, nr, res);
reg[D_CX] = rcl;
gins(AMOVQ, &n2, &n1);
......
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