diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go index 1572071ed3..101e0ea3c6 100644 --- a/src/cmd/internal/obj/util.go +++ b/src/cmd/internal/obj/util.go @@ -504,8 +504,13 @@ var Anames = []string{ } func Bool2int(b bool) int { + // The compiler currently only optimizes this form. + // See issue 6011. + var i int if b { - return 1 + i = 1 + } else { + i = 0 } - return 0 + return i }