Go patch committed: Size of int is now 64 bits on x86_64

H.J. Lu hjl.tools@gmail.com
Wed Nov 7 00:52:00 GMT 2012


On Tue, Nov 6, 2012 at 4:41 PM, Ian Lance Taylor <iant@google.com> wrote:
> 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?

Yes. I got

FAIL: ./tmp.go compilation,  -O0 -g -fno-var-tracking-assignments

> The Go library doesn't have proper support for x32 right now.  I'm not

libgo works OK on x32 since x32 doesn't need much special treatment.
The above is the only Go regression on x32.


-- 
H.J.



More information about the Gcc-patches mailing list