From d09ca03e10bc4c17e2d72f15e0460a8168603a80 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 29 Mar 2016 16:59:37 +0200 Subject: [PATCH] Work around compiler bug Benchmarks don't show any significant changes. --- storage/local/varbit.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/storage/local/varbit.go b/storage/local/varbit.go index 0555cb92d..0949e7756 100644 --- a/storage/local/varbit.go +++ b/storage/local/varbit.go @@ -759,7 +759,12 @@ func (c varbitChunk) addZeroBit(offset uint16) uint16 { // Just increase the offset. return offset + 1 } - c[offset/8] &^= bitMask[1][offset%8] + newByte := c[offset/8] &^ bitMask[1][offset%8] + c[offset/8] = newByte + // TODO(beorn7): The two lines above could be written as + // c[offset/8] &^= bitMask[1][offset%8] + // However, that tickles a compiler bug with GOARCH=386. + // See https://github.com/prometheus/prometheus/issues/1509 return offset + 1 }