This patch to the Go compiler and library changes the size of the Go type "int" to be the same as the size of a pointer. This means that on x86_64 the size of int will be 64 bits. This matches the new behaviour of the other Go compiler, and is the intended implementation for the future Go 1.1 release. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r 530c277d39c4 go/gogo.cc --- a/go/gogo.cc Tue Nov 06 10:26:29 2012 -0800 +++ b/go/gogo.cc Tue Nov 06 10:43:54 2012 -0800 @@ -23,8 +23,7 @@ // Class Gogo. -Gogo::Gogo(Backend* backend, Linemap* linemap, int int_type_size, - int pointer_size) +Gogo::Gogo(Backend* backend, Linemap* linemap, int, int pointer_size) : backend_(backend), linemap_(linemap), package_(NULL), @@ -83,6 +82,7 @@ this->add_named_type(Type::make_complex_type("complex128", 128, RUNTIME_TYPE_KIND_COMPLEX128)); + int int_type_size = pointer_size; if (int_type_size < 32) int_type_size = 32; this->add_named_type(Type::make_integer_type("uint", true, diff -r 530c277d39c4 libgo/runtime/runtime.h --- a/libgo/runtime/runtime.h Tue Nov 06 10:26:29 2012 -0800 +++ b/libgo/runtime/runtime.h Tue Nov 06 10:43:54 2012 -0800 @@ -41,8 +41,8 @@ typedef signed int intptr __attribute__ ((mode (pointer))); typedef unsigned int uintptr __attribute__ ((mode (pointer))); -typedef int intgo; // Go's int -typedef unsigned int uintgo; // Go's uint +typedef intptr intgo; // Go's int +typedef uintptr uintgo; // Go's uint /* Defined types. */