diff --git a/src/cmd/cc/scon.c b/src/cmd/cc/scon.c index 193331f774..f6031a5be7 100644 --- a/src/cmd/cc/scon.c +++ b/src/cmd/cc/scon.c @@ -175,7 +175,10 @@ evconst(Node *n) break; case OLSHR: - v = (uvlong)l->vconst >> r->vconst; + if(l->type->width != sizeof(uvlong)) + v = ((uvlong)l->vconst & 0xffffffffULL) >> r->vconst; + else + v = (uvlong)l->vconst >> r->vconst; break; case OASHR: