This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Fix 32-bit host to 64-bit target cross-compilation

In the backend interface for the Go frontend, I foolishly used size_t
for the size of a type.  That usually works, but fails when compiling
on a 32-bit host for a 64-bit target and compiling code that uses very
large types.  The maximum type size for any Go target is a signed
64-bit number, so for simplicity I changed the type size and alignment
routines to all return int64_t.  The rest of this patch adjusts the Go
frontend to deal with that correctly, and to fix the overflow checks
when dealing with types whose size does not fit into a host unsigned
long.  This is PRs 64836 and 64838.  Bootstrapped and ran Go testsuite
on x86_64-unknown-linux-gnu.  Committed to mainline.


2015-02-02  Ian Lance Taylor  <>

PR go/64836
PR go/64838
* (Gcc_backend::type_size): Change return type to
(Gcc_backend::type_alignment): Likewise.
(Gcc_backend::type_field_alignment): Likewise.
(Gcc_backend::type_field_offset): Likewise.
(Gcc_backend::implicit_variable): Change alignment parameter type
to int64_t.

Attachment: foo.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]