aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
AgeCommit message (Collapse)AuthorFilesLines
2019-03-07re PR go/89227 (gotools test cmd/go fails with link error "call lacks nop, ↵Ian Lance Taylor2-0/+7
can't restore toc; recompile with -fPIC") PR go/89227 * go-gcc.cc (Gcc_backend::function): Set TREE_PUBLIC for an only-inline function. From-SVN: r269449
2019-03-06compiler: emit underlying constant in array_type length exportIan Lance Taylor2-5/+12
In Array_type::do_export, when emitting a concrete array length, evaluate the length expression to an integer constant and emit that constant, instead of calling the more general method for emitting expressions. This is to avoid the possibility that we will need to emit a conversion, which could confuse the gccgoimporter. Fixes golang/go#30628. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165741 From-SVN: r269443
2019-03-06mksysinfo: actually use modified Statfs_t valueIan Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165737 From-SVN: r269424
2019-03-06re PR go/89598 (go frontend fails to build against mpfr 2.4.2)Ian Lance Taylor2-2/+2
PR go/89598 compiler: use GMP_RNDN rather than MPFR_RNDN Missed one last time around. This fixes the build with mpfr 2.4.2. Fixes https://gcc.gnu.org/PR89598 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165420 From-SVN: r269411
2019-03-05runtime: enable precise GC checks when using stack mapsIan Lance Taylor1-1/+1
In the runtime there are bad pointer checks that currently don't work with the concervative collector. With stack maps, the GC is precise and the checks should work. Enable them. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/153871 From-SVN: r269406
2019-03-05cmd/go: pass -X64 to ar on aix/ppc64Ian Lance Taylor1-1/+1
On aix/ppc64, ar tool must always have -X64 argument if it aims to create 64 bits archives. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165317 From-SVN: r269404
2019-03-05sysinfo: add Flags to Statfs_t if not already thereIan Lance Taylor1-1/+1
If there is no f_flags field in statfs_t then rename one of the f_spare fields, as happened in Linux kernel version 2.6.36. This fixes the build on CentOS 5.11. The CentOS kernel will hopefully not fill in the f_spare field, so the resulting flags will be zero. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165417 From-SVN: r269401
2019-03-05re PR go/89598 (go frontend fails to build against mpfr 2.4.2)Ian Lance Taylor2-3/+3
PR go/89598 compiler: use GMP_RNDN rather than MPFR_RNDN This fixes the build with mpfr 2.4.2. Fixes https://gcc.gnu.org/PR89598 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165418 From-SVN: r269399
2019-03-02re PR go/89406 (Go testing leaves many temporary directories in /tmp around)Ian Lance Taylor1-1/+1
PR go/89406 go/internal/gccgoimporter: remove temporary directories in test Backport of https://golang.org/cl/164862. Updates https://gcc.gnu.org/PR89406 Reviewed-on: https://go-review.googlesource.com/c/164863 From-SVN: r269338
2019-03-01cmd/go: restore passing D to arIan Lance Taylor1-1/+1
This restores part of https://golang.org/cl/45695 that was accidentally lost in https://golang.org/cl/158019 (the update to Go1.12beta2). Reviewed-on: https://go-review.googlesource.com/c/164737 From-SVN: r269333
2019-03-01runtime: call execname and getpagesize on SolarisIan Lance Taylor1-1/+1
Interpreting auxv as []uintptr is incorrect on 64-bit big-endian, as auxv alternates a 32-bit int with a 64-bit pointer. Patch from Rainer Orth. Reviewed-on: https://go-review.googlesource.com/c/164739 From-SVN: r269315
2019-03-01cmd/go: add -O2 to invocation of gccgoIan Lance Taylor1-1/+1
When using the go tool with gccgo, this changes the default compilation to use -O2. The -gccgoflags option can be used to override this default. I think this change better corresponds to what people expect when using the go tool. Reviewed-on: https://go-review.googlesource.com/c/164378 From-SVN: r269299
2019-03-01commit 66ac9466852d11e968f8fd2ad6ffc7386cee49e1Ian Lance Taylor1-1/+1
gotest: avoid using echo inside $() The handling of newlines is not portable between bash and ksh. Reviewed-on: https://go-review.googlesource.com/c/164597 From-SVN: r269298
2019-02-28libgo: fix go_export extraction on DarwinIan Lance Taylor1-1/+1
On Darwin, the section name is prefixed with the segment name, __GNU_GO. Reviewed-on: https://go-review.googlesource.com/c/151097 From-SVN: r269271
2019-02-27re PR go/89172 (FAIL: runtime/pprof)Ian Lance Taylor1-1/+1
PR go/89172 internal/cpu, runtime, runtime/pprof: handle function descriptors When using PPC64 ELF ABI v1 a function address is not a PC, but is the address of a function descriptor. The first field in the function descriptor is the actual PC (see http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#FUNC-DES). The libbacktrace library knows about this, and libgo uses actual PC values consistently except for the helper function funcPC that appears in both runtime and runtime/pprof. This patch fixes funcPC by recording, in the internal/cpu package, whether function descriptors are being used. We have to check for function descriptors using a C compiler check, because GCC can be configured using --with-abi to select the ELF ABI to use. Fixes https://gcc.gnu.org/PR89172 Reviewed-on: https://go-review.googlesource.com/c/162978 From-SVN: r269266
2019-02-27runtime: align first persistentalloc chunk as requestedIan Lance Taylor1-1/+1
Backport of upstream https://golang.org/cl/163859. This fixes various failures on 32-bit SPARC. Patch from Eric Boctazou. Reviewed-on: https://go-review.googlesource.com/c/163860 From-SVN: r269258
2019-02-27compiler: check duplicate numeric keys in map literalsIan Lance Taylor3-3/+115
Updates golang/go#28104 Reviewed-on: https://go-review.googlesource.com/c/162882 From-SVN: r269242
2019-02-27compiler: check recursive inherited interface aliasesIan Lance Taylor2-1/+18
Fixes golang/go#25302. Reviewed-on: https://go-review.googlesource.com/c/163298 From-SVN: r269241
2019-02-27cmd/go: preserve CC for TestScript child processesIan Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/c/158838 From-SVN: r269240
2019-02-26libgo: update to Go 1.12 releaseIan Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/c/163742 From-SVN: r269216
2019-02-26re PR go/86535 (FreeBSD/PowerPC64 - Building Go Frontend support for gcc ↵Ian Lance Taylor1-1/+1
7.3.0 fails) PR go/86535 runtime: always declare nanotime in Go For libgo it's always defined in C. Updates https://gcc.gnu.org/PR86535 Reviewed-on: https://go-review.googlesource.com/c/163743 From-SVN: r269214
2019-02-26libgo: update to Go1.12rc1Ian Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/c/162881 From-SVN: r269202
2019-02-22re PR go/89406 (Go testing leaves many temporary directories in /tmp around)Ian Lance Taylor1-1/+1
PR go/89406 net: remove unixgram test sockets Backport https://golang.org/cl/163277 from the master library. Updates https://gcc.gnu.org/PR89406 Reviewed-on: https://go-review.googlesource.com/c/163200 From-SVN: r269087
2019-02-22cmd/go: remove work directory on usage errorIan Lance Taylor1-1/+1
Backport https://golang.org/cl/163237 from the master library: Ensure that cmd/go consistently calls base.Exit rather than os.Exit, so that we don't incorrectly leave the work directory around on exit. Test this by modifying the testsuite to run all the tests with TMPDIR set to a temporary directory, and then check that no files are left behind in that temporary directory. Adjust a couple of tests to make this approach work. Updates https://gcc.gnu.org/PR89406 Reviewed-on: https://go-review.googlesource.com/c/163198 From-SVN: r269086
2019-02-21re PR go/89407 (go bootstrap failure on s390x starting with r268941)Ian Lance Taylor1-1/+1
PR go/89407 internal/cpu: use #ifdef __s390x__ in C code Patch by Jakub Jelinek. Fixes https://gcc.gnu.org/PR89407 Reviewed-on: https://go-review.googlesource.com/c/163297 From-SVN: r269063
2019-02-20compiler: fix a typo in commentsIan Lance Taylor2-2/+2
Reviewed-on: https://go-review.googlesource.com/c/163097 From-SVN: r269049
2019-02-19compiler: add debugger-callable AST dump functinsIan Lance Taylor2-2/+83
Introduce a set debug_go_* global functions that can be used to emit AST dumps for Go statements and expressions from within GDB (for use by people developing gccgo). Reviewed-on: https://go-review.googlesource.com/c/162903 From-SVN: r269027
2019-02-19re PR go/89169 (FAIL: internal/cpu)Ian Lance Taylor1-1/+1
PR go/89169 internal/cpu: do not require POWER8 Although the gc toolchain requires POWER8, the gccgo toolchain does not. Fixes https://gcc.gnu.org/PR89169 Reviewed-on: https://go-review.googlesource.com/c/162979 From-SVN: r269019
2019-02-19runtime: abort stack scan in cases that we cannot unwind the stackIan Lance Taylor1-1/+1
In signal-triggered stack scan, if the signal is delivered at certain bad time (e.g. in vdso, or in the middle of setcontext?), the unwinder may not be able to unwind the whole stack, while it still reports _URC_END_OF_STACK. So we cannot rely on _URC_END_OF_STACK to tell if it successfully scanned the stack. Instead, we check the last Go frame to see it actually reached the end of the stack. For Go-created stack, this is runtime.kickoff. For C-created stack, we need to record the outermost Go frame when it enters the Go side. Also we cannot unwind the stack if the signal is delivered in the middle of runtime.gogo, halfway through a goroutine switch, where the g and the stack don't match. Give up in this case as well. Reviewed-on: https://go-review.googlesource.com/c/159098 From-SVN: r269018
2019-02-15compiler,runtime: use __builtin_dwarf_cfa for getcallerspCherry Zhang7-21/+34
Currently, the compiler lowers runtime.getcallersp to __builtin_frame_address(1). In the C side of the runtime, getcallersp is defined as __builtin_frame_address(0). They don't match. Further, neither of them actually returns the caller's SP. On AMD64, __builtin_frame_address(0) just returns the frame pointer. __builtin_frame_address(1) returns the memory content where the frame pointer points to, which is typically the caller's frame pointer but can also be garbage if the frame pointer is not enabled. This CL changes it to use __builtin_dwarf_cfa(), which returns the caller's SP at the call site. This matches the SP we get from unwinding the stack. Currently getcallersp is not used for anything real. It will be used for precise stack scan (a new version of CL 159098). Reviewed-on: https://go-review.googlesource.com/c/162905 * go-gcc.cc (Gcc_backend::Gcc_backend): Define __builtin_dwarf_cfa instead of __builtin_frame_address. From-SVN: r268952
2019-02-15re PR go/89368 (ICE in go/gofrontend/expressions.cc:4669 after r268923)Ian Lance Taylor2-2/+3
PR go/89368 compiler: write barrier check nil-check policy tweak Tweak the recipe for generating writeBarrier loads to insure that the dereference expr is marked as not requiring a nil check (not needed for gccgo, but needed for gollvm). Fixes https://gcc.gnu.org/PR89368 Reviewed-on: https://go-review.googlesource.com/c/162904 From-SVN: r268948
2019-02-15re PR go/89123 (Too many go test failures on s390x-linux)Ian Lance Taylor1-1/+1
PR go/89123 internal/cpu, runtime: add S/390 CPU capability support Patch by Robin Dapp. Updates https://gcc.gnu.org/PR89123 Reviewed-on: https://go-review.googlesource.com/c/162887 From-SVN: r268941
2019-02-15runtime: include <syscall.h> and <sys/syscall.h> if availableIan Lance Taylor1-1/+1
Fixes Solaris build. Reviewed-on: https://go-review.googlesource.com/c/162885 From-SVN: r268940
2019-02-15runtime: add type cast for non-split-stack calls to scanstackblockIan Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/c/162884 From-SVN: r268939
2019-02-15compiler, runtime: harmonize types referenced by both C and GoIan Lance Taylor6-29/+42
Compiling with LTO revealed a number of cases in the runtime and standard library where C and Go disagreed about the type of an object or function (or where Go and code generated by the compiler disagreed). In all cases the underlying representation was the same (e.g., uintptr vs. void*), so this wasn't causing actual problems, but it did result in a number of annoying warnings when compiling with LTO. Reviewed-on: https://go-review.googlesource.com/c/160700 From-SVN: r268923
2019-02-15re PR go/89168 (FAIL: cmd/go/internal/load)Ian Lance Taylor1-1/+1
PR go/89168 libgo: change gotest to run examples with output Change the gotest script to act like "go test" and run examples that have "output" comments. This is not done with full generality, but just enough to run the libgo tests. Other packages should be tested with "go test" as usual. While we're here clean up some old bits of gotest, and only run TestXXX functions that are actually in *_test.go files. The latter change should fix https://gcc.gnu.org/PR89168. Reviewed-on: https://go-review.googlesource.com/c/162139 From-SVN: r268922
2019-02-15go-backend.c (go_imported_unsafe): Update optimization_default_node.Ian Lance Taylor2-0/+6
* go-backend.c (go_imported_unsafe): Update optimization_default_node. From-SVN: r268921
2019-02-14re PR go/89321 (cross build with riscv64 gccgo compilation failed due to ↵Ian Lance Taylor2-1/+11
assert in constructor_expression) PR go/89321 compiler: copy has_padding field from converted struct Test case is https://golang.org/cl/162617. Fixes https://gcc.gnu.org/PR89321 Reviewed-on: https://go-review.googlesource.com/c/162618 From-SVN: r268904
2019-02-14compiler: check duplicate string keys in map composite literalsIan Lance Taylor6-55/+98
Updates golang/go#28104 Reviewed-on: https://go-review.googlesource.com/c/161357 From-SVN: r268891
2019-02-14go-gcc.cc: #include "opts.h".Ian Lance Taylor2-0/+41
* go-gcc.cc: #include "opts.h". (Gcc_backend::function): Compile thunks with -Os. From-SVN: r268861
2019-02-12syscall: don't assume that WIFCONTINUED is definedIan Lance Taylor1-1/+1
It's not defined on the Hurd. Reviewed-on: https://go-review.googlesource.com/c/161963 From-SVN: r268828
2019-02-12mksysinfo: remove incorrect quotes in st_fsid handling for HurdIan Lance Taylor1-1/+1
Also stop converting st_dev on Hurd; it shouldn't appear, but if it somehow does we don't want to convert it. Reviewed-on: https://go-review.googlesource.com/c/161961 From-SVN: r268785
2019-02-07os, syscall: Hurd fixes for a couple of testsIan Lance Taylor1-1/+1
Based on patch by Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/161520 From-SVN: r268605
2019-02-07os, net, crypto/x509: add hurd supportIan Lance Taylor1-1/+1
Patch by Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/161519 From-SVN: r268604
2019-02-07syscall: add Hurd supportIan Lance Taylor1-1/+1
Loosely based on a patch by Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/161518 From-SVN: r268603
2019-02-07internal/syscall/unix: add constants for hurdIan Lance Taylor1-1/+1
Patch by Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/161517 From-SVN: r268602
2019-02-06re PR go/89199 (libgo regression in implementation of CompareAndSwap ↵Ian Lance Taylor1-1/+1
functions resulting in intermittent testcase failures on ppc64le power9 after r268458) PR go/89199 sync/atomic: use strong form of atomic_compare_exchange_n In the recent change to use atomic_compare_exchange_n I thought we could use the weak form, which can spuriously fail. But that is not how it is implemented in the gc library, and it is not what the rest of the library expects. Thanks to Lynn Boger for identifying the problem. Fixes https://gcc.gnu.org/PR89199 Reviewed-on: https://go-review.googlesource.com/c/161359 From-SVN: r268591
2019-02-06README: update text to describe current statusIan Lance Taylor2-27/+30
Reviewed-on: https://go-review.googlesource.com/c/161338 From-SVN: r268584
2019-02-06re PR go/89019 (LTO and gccgo cause ICE during free_lang_data)Nikhil Benesch2-0/+16
gcc/go: PR go/89019 * go-gcc.cc (Gcc_backend::placeholder_struct_type): Mark placeholder structs as requiring structural equality. (Gcc_backend::set_placeholder_pointer_type): Propagate the canonical type from the desired pointer type to the placeholder pointer type. gcc/testsuite/: * lib/go-torture.exp: Test compiling with -flto. From-SVN: r268572
2019-02-05compiler: check duplicate implicit indexes in slices/arraysIan Lance Taylor2-1/+8
Fixes golang/go#28186. Reviewed-on: https://go-review.googlesource.com/c/160832 From-SVN: r268554