This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Go patch committed: Size of int is now 64 bits on x86_64
On Tue, Nov 6, 2012 at 4:32 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Nov 6, 2012 at 10:46 AM, Ian Lance Taylor <iant@google.com> wrote:
>> 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
>>
>
> On x32, I saw
>
> spawn -ignore SIGHUP
> /export/build/gnu/gcc-x32-mx32-native/build-x86_64-linux/gcc/testsuite/go3/../../gccgo
> -B/export/build/gnu/gcc-x32-mx32-native/build-x86_64-linux/gcc/testsuite/go3/../../
> ./tmp.go -fno-diagnostics-show-caret
> -I/export/build/gnu/gcc-x32-mx32-native/build-x86_64-linux/x86_64-unknown-linux-gnu/./libgo
> -w -O0 -g -fno-var-tracking-assignments
> -L/export/build/gnu/gcc-x32-mx32-native/build-x86_64-linux/x86_64-unknown-linux-gnu/./libgo
> -L/export/build/gnu/gcc-x32-mx32-native/build-x86_64-linux/x86_64-unknown-linux-gnu/./libgo/.libs
> -lm -mx32 -o /export/build/gnu/gcc-x32-mx32-native/build-x86_64-linux/gcc/testsuite/go3/tmp.x^M
> ./tmp.go:932:21: error: array index out of bounds^M
> ./tmp.go:933:23: error: array index out of bounds^M
> ./tmp.go:934:23: error: array index out of bounds^M
> ...
>
> Is this expected?
I assume this led to a test failure?
The Go library doesn't have proper support for x32 right now. I'm not
even sure what the runtime.GOARCH value should be. I would not be
surprised if there are some Go testsuite failures when running in x32
mode.
Ian