[dev.power64] cmd/9c: fix constant truncation in optimizer

This is what broke getpopcount, but that code had it coming.

LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/130000044
This commit is contained in:
Russ Cox 2014-08-14 14:34:14 -04:00
parent 80e76e272a
commit 25bde37af4
1 changed files with 3 additions and 1 deletions

View File

@ -558,7 +558,7 @@ mkvar(Addr *a, int docon)
{
Var *v;
int i, t, n, et, z;
int32 o;
int64 o;
Bits bit;
LSym *s;
@ -617,6 +617,8 @@ out:
for(z=0; z<BITS; z++)
addrs.b[z] |= bit.b[z];
if(t == D_CONST) {
if((int32)o != o)
v->etype = TVLONG;
if(s == nil) {
for(z=0; z<BITS; z++)
consts.b[z] |= bit.b[z];