libgo patch committed: Make NumGoroutine wait for system goroutines to register

2017-06-22 Thread Ian Lance Taylor
In libgo system goroutines register themselves after they start. That means that there is a small race between the goroutine being seen by the scheduler and the scheduler knowing that the goroutine is a system goroutine. That in turn means that runtime.NumGoroutines can overestimate the number of

Re: libgo patch committed: Change some stack fields to uintptr

2017-06-22 Thread Ian Lance Taylor
On Thu, Jun 22, 2017 at 11:09 AM, Rainer Orth wrote: > >> Because of how gccgo implements cgo calls, the code in dropm may not >> have any write barriers. As a step toward implementing that, change >> the gcstack, gcnextsegment, and gcnextsp fields of the g struct to >> uintptr, so that assignmen

Re: libgo patch committed: Fix ptrace implementation on MIPS

2017-06-22 Thread Ian Lance Taylor
James, any thoughts? Ian On Thu, Jun 22, 2017 at 12:55 AM, Andreas Schwab wrote: > On Jun 21 2017, Ian Lance Taylor wrote: > >> Index: libgo/sysinfo.c >> === >> --- libgo/sysinfo.c (revision 249205

libgo patch committed: Export getm for test

2017-06-22 Thread Ian Lance Taylor
This patch to libgo exports the getm function so that it can be referenced by a test (from runtime/testdata/testprogcgo/dropm_stub.go). The test is not currently run, but it will be soon. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofronte

libgo patch committed: Mark dropm and callees nowritebarrierrec

2017-06-22 Thread Ian Lance Taylor
The CgocallbackDone function calls dropm after it calls entersyscall, which means that dropm must not have any write barriers. Mark it accordingly. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE

libgo patch committed: Uncomment check for gchelper on g0 stack

2017-06-22 Thread Ian Lance Taylor
This libgo patch uncomments a check. Now that systemstack changes to the g0 stack, the check passes. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE === --- gcc/go

libgo patch committed: Improve handling of panic during deferred function

2017-06-23 Thread Ian Lance Taylor
When a Go panic occurs while processing a deferred function that recovered an earlier panic, we shouldn't report the recovered panic in the panic stack trace. This libgo patch stops doing so by keeping track of the panic that triggered a defer, marking it as aborted if we see the defer again, and d

Re: libgo patch committed: Fix ptrace implementation on MIPS

2017-06-23 Thread Ian Lance Taylor
On Fri, Jun 23, 2017 at 2:34 AM, James Cowgill wrote: > Hi, > > On 22/06/17 20:59, Ian Lance Taylor wrote: >> James, any thoughts? >> >> Ian >> >> On Thu, Jun 22, 2017 at 12:55 AM, Andreas Schwab wrote: >>> On Jun 21 2017, Ian Lanc

Go patch committed: Add go:notinheap magic comment

2017-06-23 Thread Ian Lance Taylor
This patch to the Go frontend implements go:notinheap as the gc compiler does. A type marked as go:notinheap may not live in the heap, and does not require a write barrier. Struct and array types that incorporate notinheap types are themselves notinheap. Allocating a value of a notinheap type on th

libgo patch committed: Don't crash if no p in kickoff

2017-06-23 Thread Ian Lance Taylor
In libgo the kickoff function for g0 can be invoked without a p, for example from mcall(exitsyscall0) in exitsyscall after exitsyscall has cleared the p field. The assignment gp.param = nil will invoke a write barrier. If gp.param is not already nil, this will require a p. Avoid the problem for a

libgo patch committed: Align siginfo argument to waitid

2017-06-23 Thread Ian Lance Taylor
Backport a patch just committed to gc tip. There is a bug report on the golang-dev mailing list (https://groups.google.com/d/msg/golang-dev/sDg-t1_DPw0/-AJmLxgPBQAJ) in which waitid running on MIPS returns EFAULT, and this patch may fix the problem. Bootstrapped and ran Go tests on x86_64-pc-linu

libgo patch committed: Don't require GOROOT

2017-06-23 Thread Ian Lance Taylor
This patch to libgo changes the libgo version of the go tool to not require GOROOT. GOROOT is only required for the gc toolchain, and is not necessary for gccgo. This fixes running the gotools testsuite in a GCC build directory when using a --prefix for which you've never run `make install`. Boo

libgo patch committed: Complete defer handling in CgocallBackDone

2017-06-23 Thread Ian Lance Taylor
This patch to libgo completes the handling of a cgo-generated defer in CgocallBackDone. When C code calls a Go function, it actually calls a function generated by cgo. That function is written in Go, and, among other things, it calls the real Go function like this: CgocallBack() defer Cgoc

libgo patch RFC: Test the runtime package with the go tool

2017-06-23 Thread Ian Lance Taylor
more testing. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Ian 2017-06-23 Ian Lance Taylor * Makefile.am (MOSTLYCLEANFILES): Remove testing files and logs. (mostlyclean-local): Remove check-runtime-dir. (ECHO_ENV): Define. (check-go-tool): Depend on cgo. Write command to testlog

Merge from GCC trunk to gccgo branch

2017-06-25 Thread Ian Lance Taylor
I merged GCC trunk revision 249632 to the gccgo branch. Ian

Re: libgo patch committed: Fix ptrace implementation on MIPS

2017-06-26 Thread Ian Lance Taylor
On Sat, Jun 24, 2017 at 12:04 AM, Andreas Schwab wrote: > On Jun 23 2017, Ian Lance Taylor wrote: > >> Andreas, can we avoid the problem for earlier glibc versions with a >> patch like the appended? >> >> Ian >> >> diff --git a/libgo/sysinfo.c b/libgo/sy

Re: [PATCH, alpha, go]: Remove PtraceRegs definition to restore bootstrap

2017-06-26 Thread Ian Lance Taylor
On Mon, Jun 26, 2017 at 12:24 AM, Uros Bizjak wrote: > > libgo is now able to automatically determine PtraceRegs. Attached > patch removes duplicate manual definition from system dependent > source. > > Bootstrapped and regression tested on alphaev68-linux-gnu. Thanks. Committed to mainline. Ia

Re: [PATCH, alpha, go]: Introduce applyRelocationsALPHA

2017-06-26 Thread Ian Lance Taylor
const defaultCXX = "/usr/local/bin/g++" > const defaultPkgConfig = "pkg-config" > > The absolute path is wrong, since - as mentioned above - the system > compiler is installed in /usr/bin. > > Probably we just need to remove $bindir and assume

libgo patch commited: Add misc/cgo files

2017-06-26 Thread Ian Lance Taylor
This patch adds the misc/cgo files from the Go 1.8.3 release to libgo. These will be used for tests of the go tool in various modes. Bootstrapped on x86_64-pc-linux-gnu. Committed to mainline. Ian patch.txt.gz Description: GNU Zip compressed data

Re: [gofrontend-dev] [PATCH, go]: S/390: Fix generation of PtraceRegs

2017-06-27 Thread Ian Lance Taylor
On Tue, Jun 27, 2017 at 12:52 AM, Andreas Krebbel wrote: > > go bootstrap fails on s390x starting with r249472. With including the ptrace > header the s390 special > code in mksysinfo.sh isn't used anymore: > > if test "$regs" = ""; then > # s390 > regs=`grep '^type __user_regs_struct struct'

libgo patch committed: AIX memory management

2017-06-27 Thread Ian Lance Taylor
On AIX: * mmap does not allow to map an already mapped range, * mmap range start at 0x3000 for 32 bits processes, * mmap range start at 0x7000_ for 64 bits processes This libgo patch by Matthieu Sarter addresses these issues. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu

libgo patch committed: Fixes for go tool for other build modes

2017-06-29 Thread Ian Lance Taylor
This libgo patch fixes the go tool when using -buildmode={c-archive,c-shared,pie} with gccgo. The tests are misc/cgo tests that are not currently run but will be run soon. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE

libgo patch committed: Fix testcarchive to work with gccgo

2017-06-29 Thread Ian Lance Taylor
This patch fixes the misc/cgo/testcachive test to work with gccgo. This test is not currently run, but it will be soon. Bootstrapped on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE === --- gcc/go/go

gotools patch committed: Test runtime, misc/cgo/{test,testcarchive}

2017-06-29 Thread Ian Lance Taylor
. Ian 2017-06-29 Ian Lance Taylor * Makefile.am (MOSTLYCLEANFILES): Remove testing files and logs. (mostlyclean-local): Remove check-runtime-dir, cgo-test-dir, carchive-test-dir. (ECHO_ENV): Define. (check-go-tool): Depend on cgo. Write command to testlog. (check-runtime): New target. (check-cgo

Re: libbacktrace patch committed: Support compressed debug sections

2017-11-07 Thread Ian Lance Taylor
On Sat, Nov 4, 2017 at 3:07 AM, Gerald Pfeifer wrote: > On Fri, 6 Oct 2017, Ian Lance Taylor wrote: >> Thanks for the report. I committed this patch, which I hope will fix >> the problem. > >> * ztest.c (test_large): Pass unsigned long *, not size_t *, to >> zlib

libgo patch committed: Don't assume that reads from address 0 crash

2017-11-09 Thread Ian Lance Taylor
This libgo patch from Tony Reix fixes libgo on AIX, where reads from address 0 simply return 0 rather than crashing with a segmentation violation. The libgo code was expecting the latter, which caused some tests to fail. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to main

Go patch committed: Remove LHS/RHS setting for variables

2017-11-14 Thread Ian Lance Taylor
This patch to the Go frontend by Than McIntosh removes the LHS/RHS context determination for variable references. It used to be needed for a different backend but it's no longer necessary. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian 2017-11-14 Than M

Go patch committed: report error for ++/-- applied to a non-numeric type

2017-11-20 Thread Ian Lance Taylor
This patch to the Go frontend reports an error when ++ or -- is used with a non-numeric type. This avoids a later compiler crash. This fixes GCC PR 83071. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE ===

libgo patch committed: Fix Makefile bug setting LD_LIBRARY_PATH

2017-11-20 Thread Ian Lance Taylor
This patch by Than McIntosh fixes a small bug in the libgo Makefile recipe that constructs the directory from which to pick up libgcc_s.so; the gccgo invocation with -print-libgcc-file-name was missing the flags, which meant that for -m32 builds we'd see the 64-bit libgcc dir. Bootstrapped and ran

Re: libgo patch committed: Fix Makefile bug setting LD_LIBRARY_PATH

2017-11-21 Thread Ian Lance Taylor
On Tue, Nov 21, 2017 at 11:53 AM, Eric Botcazou wrote: >> This patch by Than McIntosh fixes a small bug in the libgo Makefile >> recipe that constructs the directory from which to pick up >> libgcc_s.so; the gccgo invocation with -print-libgcc-file-name was >> missing the flags, which meant that f

Re: [PATCH] PR libstdc++/48101 improve errors for invalid container specializations

2017-11-22 Thread Ian Lance Taylor
On Wed, Nov 22, 2017 at 3:06 AM, Jonathan Wakely wrote: > On 22/11/17 10:56 +, Jonathan Wakely wrote: >> >> On 22/11/17 11:23 +0100, Rainer Orth wrote: >>> >>> Hi Jonathan, >>> This uses static_assert to improve the errors when attempting to instantiate invalid specializations of con

libgo patch committed: Pass -X option to ar on AIX

2017-11-22 Thread Ian Lance Taylor
This libgo patch by Tony Reix passes a -X option to ar on AIX, so that it does the right object file handling. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE === -

Go patch committed: Don't make map zero value constant

2017-11-29 Thread Ian Lance Taylor
This patch changes the Go frontend to not make the map zero value constant. The map zero value is a common symbol, and it doesn't really make sense to have a constant common symbol. Current GCC has started to reject this case, probably as part of the fix for PR 83100. Bootstrapped and ran Go tests

Re: [C PATCH] More constistent treatment of C initializers (PR c/83222)

2017-11-30 Thread Ian Lance Taylor
Jakub Jelinek writes: > between static var initializers inside of a function and outside of > functions. Apparently we've done that earlier, but only at -O1 and above > where decl_constant_value would be called and in initializers inside of > functions would fold to DECL_INITIAL if other conditi

Go patch committed: Add size threshold for nil checks

2017-12-01 Thread Ian Lance Taylor
This patch to the Go frontend by Than McIntosh adds a new control variable to the Gogo class that stores the size threshold for nil checks. This value can be used to control the policy for deciding when a given deference operation needs a check and when it does not. A size threshold of -1 means tha

Go patch committed: Avoid middle-end control flow warnings

2017-12-01 Thread Ian Lance Taylor
12-01 Ian Lance Taylor * go-gcc.cc (Gcc_backend::Gcc_backend): Define __builtin_unreachable. (Gcc_backend::function): Add does_not_return parameter. Index: gcc/go/go-gcc.cc === --- gcc/go/go-gcc.cc(revision 255340) +++ gcc/go

libgo patch committed: Export cgoCheck functions

2017-12-01 Thread Ian Lance Taylor
This patch to libgo exports the cgoCheck functions. The functions cgoCheckPointer and cgoCheckResult are called by code generated by cgo. That means that we need to export them using go:linkname, as otherwise they are local symbols. The cgo code currently uses weak references to only call the symb

Go patch committed: Omit nil check when dereferencing closure variable

2017-12-04 Thread Ian Lance Taylor
This patch to the Go frontend by Than McIntosh adds the "no nil check needed" annotation to the dereference operations created in Parse::enclosing_var_reference (this is safe since the closure object is under control of the compiler, and pointer fields in it will always be non-nil). Bootstrapped a

Go patch committed: Handle nil checks with set-and-use temporaries

2017-12-06 Thread Ian Lance Taylor
This patch by Than McIntosh changes the Go frontend code in Unary_expression::do_get_backend that introduces explicit nil checks for dereference operations to special case set-and-use-temporary expressions. For this case it is better to generate an explicit reference of the temp in the final condit

libgo patch committed: Remove -fplan9-extensions from CFLAGS

2017-12-06 Thread Ian Lance Taylor
This patch by Than McIntosh removes -fplan9-extensions from the CFLAGS used for libgo. It is no longer needed since the runtime was converted from C to Go. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE ===

Re: [PATCH,AIX] Nil check size threshold control for AIX

2017-12-12 Thread Ian Lance Taylor
d made by means of gmake. > > ChangeLog: > * go-lang.c (go_langhook_init): Handle AIX case for > nil_check_size_threshold. Thanks. I changed it to avoid #ifdef in the middle of the function, and committed as follows. Ian 2017-12-12 Tony Reix Ian Lance Taylor * go-lang.c

libgo patch committed: emulate Flock on AIX

2017-12-15 Thread Ian Lance Taylor
This patch by Tony Reix adds an emulation of the Flock call to libgo's syscall package on AIX. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE === --- gcc/go/gofrontend/MERGE (revision 255666) +++ gcc/go/gofrontend/MERG

libgo patch committed: use hostname -s on AIX

2017-12-15 Thread Ian Lance Taylor
This patch by Tony Reix changes the libgo tests for the os package on AIX to use hostname -s, not plain hostname. Bootstrapped and ran Go tests on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE === --

Go frontend patch committed: Improve escape analysis diagnostics

2017-12-21 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang improves the escape analysis diagnostics. This brings the diagnostics closer to those generated by the gc compiler, which makes porting and debugging the escape analysis code easier. - In the gc compiler, the variable expression is represented with th

Go patch committed: Bring escape analysis mostly in line with gc compiler

2017-12-22 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang brings the Go frontend's escape analysis mostly in line with gc compiler. Changes include: - In the gc compiler, the variable expression is represented with the variable node itself (ONAME). It is the same node used in the AST for multiple var express

Go patch committed: do not propagate address-taken of slice element to slice

2017-12-22 Thread Ian Lance Taylor
This patch by Cherry Zhang fixes the Go frontend to not propagate address-taken of a slice element to the slice. Array_index_expression may be used for indexing/slicing array or slice. If a slice element is address taken, the slice itself is not necessarily address taken. Only propagate address-ta

Go patch committed: Correct type of long double builtin math functions

2018-01-05 Thread Ian Lance Taylor
using the direct instruction (fsqrt, etc.). Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian 2018-01-05 Ian Lance Taylor * go-gcc.cc (Gcc_backend::Gcc_backend): Correct math_function_type_long to take one argument. Index: go-gcc.cc

libgo patch committed: Fix GOARCH_CACHELINESIZE on ia64

2018-01-05 Thread Ian Lance Taylor
This libgo patch by James Clarke fixes GOARCH_CACHELINESIZE on ia64. Bootstrapped on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE === --- gcc/go/gofrontend/MERGE (revision 256262) +++ gcc/go/gofr

Go patch committed: Update to Go1.10beta1

2018-01-08 Thread Ian Lance Taylor
and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian 2018-01-08 Ian Lance Taylor * Makefile.am (go_cmd_vet_files): New variable. (go_cmd_buildid_files, go_cmd_test2json_files): New variables. (s-zdefaultcc): Change from constants to functions. (noinst_PROGRAMS): Add vet, bu

libgo patch committed: add path to AIX certificate file

2018-05-29 Thread Ian Lance Taylor
This libgo patch by Tony Reix adds a patch to the AIX certificate file. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE === --- gcc/go/gofrontend/MERGE (revision

libgo patch committed: make vet tool work with gccgo

2018-05-29 Thread Ian Lance Taylor
Update libgo so that the vet tool works with gccgo. This is a backport of https://golang.org/cl/113715 and https://golang.org/cl/113716: cmd/go: don't pass -compiler flag to vet Without this running go vet -compiler=gccgo causes vet to fail. The vet tool does need to know the compiler, but it is

libgo patch committed: Update to Go 1.10.2 release

2018-05-31 Thread Ian Lance Taylor
This patch to libgo updates it to the 1.10.2 release. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE === --- gcc/go/gofrontend/MERGE (revision 260913) +++ gcc/

GCC 8 branch: update to Go 1.10.2, other fixes

2018-05-31 Thread Ian Lance Taylor
rnal/load to go/build. Ian gotools/ChangeLog: Backport from mainline: 2018-05-09 Ian Lance Taylor * Makefile.am (check-go-tool): Don't copy zstdpkglist.go. * Makefile.in: Rebuild. Index: gotools/Makefile.am === --- gotools/M

Go patch committed: Don't crash on cyclic var/type dependencies

2018-06-04 Thread Ian Lance Taylor
This patch by Than McIntosh fixes type traversal in the Go frontend to avoid compiler crashes for test cases where a type T includes an expression that refers back to the type without actually explicitly mentioning T. Examples include: var x [uintptr(unsafe.Sizeof(&x))]byte var a [len(a)]int

libgo patch committed: Canonicalize types returned by StructOf, et. al.

2018-06-05 Thread Ian Lance Taylor
This libgo patch by Massimiliano Ghilardi changes the reflect package to canonicalize types returned by StructOf() and friends. Since gccgo does not currently merge identical types at link time, the reflect function canonicalize() exists to choose a canonical specimen for each set of identical typ

libgo patch committed: Fix hash/string values computed by reflect.StructOf

2018-06-06 Thread Ian Lance Taylor
This libgo patch adjusts the hash and string fields computed by reflect.StructOf to match the values that the compiler computes for a struct type with the same field names and types. This makes the reflect code match the compiler's Type::hash_for_method and Type::reflection methods. This fixes ht

Go patch committed: Speed up variable initializer sorting

2018-06-07 Thread Ian Lance Taylor
The Go frontend used to do variable initializer sorting by looping through all the initialized variables and, for each one, looping through all the initialized variables and checking for a dependency. For very large packages with thousands of initialized global variables, this quadratic loop could

Merge from trunk to gccgo branch

2018-06-07 Thread Ian Lance Taylor
I've merged trunk revision 261284 to the gccgo branch. Ian

Go patch committed: Remove stack_allocation_expression

2018-06-08 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang removes stack_allocation_expression from the backend interface. Now that we consistently use temporary variables for temporaries, stack_allocation_expression is no longer used. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to ma

libgo patch committed: Add riscv and js/wasm

2018-06-11 Thread Ian Lance Taylor
This libgo patch add riscv and js/wasm as known targets. This incorporates cut down versions of https://golang.org/cl/102835 and https://golang.org/cl/106256 from the master sources. This will tell the go/build to skip files with those tags. Bootstrapped and ran Go testsuite on x86_64-pc-linux-g

Re: libgo patch committed: Add riscv and js/wasm

2018-06-11 Thread Ian Lance Taylor
On Mon, Jun 11, 2018 at 12:22 PM, Palmer Dabbelt wrote: > On Mon, 11 Jun 2018 12:16:39 PDT (-0700), i...@golang.org wrote: >> >> This libgo patch add riscv and js/wasm as known targets. This >> incorporates cut down versions of https://golang.org/cl/102835 and >> https://golang.org/cl/106256 from

libgo patch committed: Update to 1.10.3 release

2018-06-13 Thread Ian Lance Taylor
This patch updates libgo to the 1.10.3 release. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline and GCC 8 branch. Ian Index: gcc/go/gofrontend/MERGE === --- gcc/go/gofrontend/MERGE (revision 26152

libgo patch committed: Dump preinit blocks in AST dumps

2018-06-13 Thread Ian Lance Taylor
This patch to the Go frontend by Than McIntosh includes global variable preinit blocks in AST dumps. Each preinit block is prefixed with a comment indicating the variable it is initializing. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofron

Go patch committed: Avoid introducing redundant write barriers

2018-06-13 Thread Ian Lance Taylor
This patch to the Go frontend by Than McIntosh fixes the compier to avoid introducing redundant write barriers. The traversal used by the write barrier insertion phase can sometimes wind up visiting new statements inserted during the traversal, which then results in duplicate / redundant write bar

Re: [PATCH] fix PR 86213, split stack runtime clobber of SSE reg

2018-06-20 Thread Ian Lance Taylor
On Wed, Jun 20, 2018 at 12:02 PM, Than McIntosh wrote: > > Please find below a patch to fix PR 86213. This changes the runtime > code for -fsplit-stack to move a couple of calls (getenv, etc) from > the routine called by __morestack to a function called on startup, > so as to avoid having the call

Re: [PATCH] fix PR 86213, split stack runtime clobber of SSE reg

2018-06-20 Thread Ian Lance Taylor
On Wed, Jun 20, 2018 at 2:11 PM, Ian Lance Taylor wrote: > On Wed, Jun 20, 2018 at 12:02 PM, Than McIntosh wrote: >> >> Please find below a patch to fix PR 86213. This changes the runtime >> code for -fsplit-stack to move a couple of calls (getenv, etc) from >> the ro

libgo patch committed: Re-enable a couple of tests

2018-06-21 Thread Ian Lance Taylor
This libgo patch re-enables a couple of tests that are specific gccgo. This is a port of https://golang.org/cl/120375 so that it gets more reliable testing. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE ===

libgo patch committed: Remove syscall.Ustat

2018-06-22 Thread Ian Lance Taylor
Reportedly glibc 2.28 removes the ustat.h header file and the ustat function. This breaks libgo, which provides syscall.Ustat that calls the C ustat function. Fix this by removing syscall.Ustat from libgo. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline, GCC 8 bra

libgo patch committed: Test USING_SPLIT_STACK using #ifdef, not #if

2018-06-22 Thread Ian Lance Taylor
This patch by Cherry Zhang fixes the libgo runtime code to consistently use #ifdef instead of #if for USING_SPLIT_STACK. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE

GCC 6 patch RFA: libgo: Remove syscall.Ustat

2018-06-25 Thread Ian Lance Taylor
Since it looks like there might be a 6.5 release, here is backport of https://gcc.gnu.org/ml/gcc-patches/2018-06/msg01420.html to GCC 6 branch. This removes the syscall.Ustat function from libgo, since the ustat function is being removed from new versions of glibc. Bootstrapped and ran Go tests

Go patch committed: Escape analysis improvements

2018-06-25 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang adds some escape analysis improvements to the Go frontend. These are based on earlier patches to the gc compiler. - https://golang.org/cl/99335: unnamed receiver should not escape. - https://golang.org/cl/105257: propagate loop depth to field. This p

Go patch committed: Use build_variant_type_copy, not build_distinct_type_copy

2018-06-28 Thread Ian Lance Taylor
right relationship for the DECL_CONTEXT setting. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian 2018-06-28 Ian Lance Taylor PR go/86343 * go-gcc.cc (Gcc_backend::set_placeholder_struct_type): Call build_variant_type_copy rather than

libgo patch committed: Don't stat a NULL filename

2018-06-28 Thread Ian Lance Taylor
The libgo code to create a backtrace state would sometimes call stat(NULL). This didn't matter, since the stat failure would not cause any further problem, but it was pointless and sloppy. The problem was pointed out by Andreas Schwab in PR 86331. This patch removes it. Bootstrapped and ran Go

Re: [PATCH] libtool: Sort output of 'find' to enable deterministic builds.

2018-06-29 Thread Ian Lance Taylor
On Fri, Jun 29, 2018 at 8:43 AM, Jakub Jelinek wrote: > On Fri, Jun 29, 2018 at 09:09:38AM -0600, Jeff Law wrote: >> > Btw, running find to search for libtool.m4/ltmain.sh I find extra copies in >> > >> > ./libgo/config/ltmain.sh >> > ./libgo/config/libtool.m4 >> > >> > which are nearly identical

Go patch committed: Use macro Unordered_map instead of std::unordered_map

2018-01-09 Thread Ian Lance Taylor
This patch by Cherry Zhang fixes a case in the Go frontend that was using std::unodered_map where it should use the macro Unordered_map for more portability. Bootstrapped on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE ===

Go patch committed: Add escape analysis debug hash

2018-01-09 Thread Ian Lance Taylor
This patch by Cherry Zhang adds a new -fgo-debug-escape-hash option to the Go frontend. This option takes a string that can be used to select specific functions on which to run escape analysis. This makes it easier to find escape analysis bugs by doing a binary search over all the functions, enab

Go patch committed: Make top-level decl for address-taken non-escaping locals

2018-01-09 Thread Ian Lance Taylor
In the Go frontend, if a local variable's address is taken and passed out of its lexical scope, the GCC middle-end may reuse the stack slot for the variable, not knowing it is still live through a pointer. This patch by Cherry Zhang creates a top-level temporary variable and let the user-defined va

Re: Go patch committed: Update to Go1.10beta1

2018-01-09 Thread Ian Lance Taylor
On Tue, Jan 9, 2018 at 12:26 PM, Rainer Orth wrote: > Hi Ian, > >> This patch updates libgo to the Go1.10beta1 release. The final Go >> 1.10 release is expected around February 1, so it's not clear how the >> release timing is going to work with GCC 8. In any case this updates >> GCC to somethin

Go patch committed: Delay escaping sliced arrays

2018-01-09 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang delays escaping sliced arrays. Arrays that are sliced are set to escape in type checking, very early in compilation. The escape analysis runs later but cannot undo it. This patch changes it to not escape in the early stage. Later the escape analysis

Go patch committed: Stack allocate non-escaping constant make of slice

2018-01-09 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang stack allocates a non-escaping make of a slice type with a constant length and capacity. Bootstrapped on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE ===

Go patch committed: Support go:noescape cross package

2018-01-09 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang adds support for the go:noescape compilation pragma across packages. https://golang.org/cl/83876 added support for the go:noescape pragma, but only for functions called from the same package. The pragma did not take effect for exported functions that a

Go patch committed: Do some escape checks earlier

2018-01-09 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang moves some checks of escape state earlier, from get_backend to Mark_address_taken. This permits us to reclaim escape analysis Nodes before kicking off the backend (although that is not done in this patch). Also it makes it easier to check variables a

Go patch committed: Don't heap allocate non-escaping Bound_method_expression

2018-01-09 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang makes non-escaping Bound_method_expression not heap allocate. It stack allocates the closure when it does not escape. Bootstrapped on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE

Go patch committed: Stack allocate defer thunk

2018-01-09 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang stack allocates defer thunk when possible, which is to say when the defer statement is not in a loop. Bootstrapped on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =

Go patch committed: Set captured var address to not escape before flood

2018-01-09 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang sets captured variable addresses to nonescape until the flood phase. The escape analysis pass models closures by flowing captured variable address to the closure node. However, the escape state for the address expressions remained unset as ESCAPE_UNKN

Go patch committed: Use temporary variable for stack allocation

2018-01-09 Thread Ian Lance Taylor
This patch to the Go frontend by Cherry Zhang uses a temporary variable for stack allocation when possible. Currently, an allocation expression that can be allocated on stack is implemented with __builtin_alloca, which turns into __morestack_allocate_stack_space, which may call the C malloc functi

libgo patch committed: Add aix build tags

2018-01-09 Thread Ian Lance Taylor
This patch by Tony Reix adds some aix build tags to new libgo files. Bootstrapped on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE === --- gcc/go/gofrontend/MERGE (revision 256412) +++ gcc/go/gofr

libgo patch committed: Add AIX support to cmd/go

2018-01-09 Thread Ian Lance Taylor
This patch by Tony Reix adds AIX support to cmd/go in libgo. For gccgo code avoid --whole-archive and -(. Use -blibpath instead of -rpath. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE

libgo patch committed: Add some noescape cases to runtime

2018-01-09 Thread Ian Lance Taylor
This libgo patch by Cherry Zhang adds some noescape cases to the runtime package. This is in preparation of turning on escape analysis for the runtime. - In gccgo, systemstack is implemented with mcall, which is not go:noescape. Wrap the closure in noescape so the escape analysis does not th

libgo patch committed: Work around escaping closure in runtime/export_test.go

2018-01-09 Thread Ian Lance Taylor
This libgo patch by Cherry Zhang works around some escaping code in runtime/export_test.go. When compiling the runtime, local variables and closures may not be heap allocated. In one test, there is a go statement with a closure. In the gc compiler, it distinguishes capturing variable by value vs

Re: Go patch committed: Update to Go1.10beta1

2018-01-10 Thread Ian Lance Taylor
On Tue, Jan 9, 2018 at 11:34 PM, Uros Bizjak wrote: >> This patch updates libgo to the Go1.10beta1 release. The final Go >> 1.10 release is expected around February 1, so it's not clear how the >> release timing is going to work with GCC 8. In any case this updates >> GCC to something pretty clo

Re: Go patch committed: Update to Go1.10beta1

2018-01-10 Thread Ian Lance Taylor
On Wed, Jan 10, 2018 at 5:35 AM, Ian Lance Taylor wrote: > On Tue, Jan 9, 2018 at 11:34 PM, Uros Bizjak wrote: >>> This patch updates libgo to the Go1.10beta1 release. The final Go >>> 1.10 release is expected around February 1, so it's not clear how the >>> r

Re: Go patch committed: Update to Go1.10beta1

2018-01-10 Thread Ian Lance Taylor
On Wed, Jan 10, 2018 at 3:44 AM, Rainer Orth wrote: > >>> the patch broke Solaris bootstrap: >>> >>> mv: cannot stat 'os/signal/internal/pty.s-gox.tmp': No such file or >>> directory >>> make[4]: *** [Makefile:3348: os/signal/internal/pty.s-gox] Error 1 >>> make[4]: *** Waiting for unfinished job

Re: [PATCH v2] libgo: Add support for sh

2018-01-10 Thread Ian Lance Taylor
On Sun, Dec 17, 2017 at 4:38 AM, John Paul Adrian Glaubitz wrote: > > This is the second version of my patch to add support for SuperH > in libgo. The changes over my first patch in [1] are: > > * account for little- and big-endian targets > * account for sh3- and sh4-specific parameters > > I h

Re: Go patch committed: Update to Go1.10beta1

2018-01-10 Thread Ian Lance Taylor
On Wed, Jan 10, 2018 at 6:00 AM, Uros Bizjak wrote: > On Wed, Jan 10, 2018 at 2:37 PM, Ian Lance Taylor wrote: >> On Wed, Jan 10, 2018 at 5:35 AM, Ian Lance Taylor wrote: >>> On Tue, Jan 9, 2018 at 11:34 PM, Uros Bizjak wrote: >>>>> This patch updates libgo

Re: [PATCH v2] libgo: Add support for sh

2018-01-10 Thread Ian Lance Taylor
On Wed, Jan 10, 2018 at 6:30 AM, John Paul Adrian Glaubitz wrote: > On 01/10/2018 03:25 PM, Ian Lance Taylor wrote: >> >> Thanks. I finally took a look at this. I don't know much about SH, >> but I don't think we want to add each SH variant as a separate GOARCH

Re: [PATCH v2] libgo: Add support for sh

2018-01-10 Thread Ian Lance Taylor
On Wed, Jan 10, 2018 at 6:30 AM, Oleg Endo wrote: > On Wed, 2018-01-10 at 06:25 -0800, Ian Lance Taylor wrote: >> >> Thanks. I finally took a look at this. I don't know much about SH, >> but I don't think we want to add each SH variant as a separate GOARCH >

Re: Go patch committed: Update to Go1.10beta1

2018-01-10 Thread Ian Lance Taylor
On Wed, Jan 10, 2018 at 3:44 AM, Rainer Orth wrote: > > thanks. Testing has now concluded as well. x86 results are good (no > regressions except for cmd/internal/buildid which fails on Linux, too), > as are 64-bit sparc results. The cmd/internal/buildid test does pass on my system. What are yo

Re: Go patch committed: Update to Go1.10beta1

2018-01-10 Thread Ian Lance Taylor
On Wed, Jan 10, 2018 at 5:42 AM, Ian Lance Taylor wrote: > > Whoops, there's a bug on big-endian 32-bit systems. I'm testing > https://golang.org/cl/87135. Committed as follows. Ian Index: gcc/go/gofrontend/MERGE ===

Re: [gofrontend-dev] Re: Go patch committed: Update to Go1.10beta1

2018-01-10 Thread Ian Lance Taylor
On Wed, Jan 10, 2018 at 6:34 AM, Ian Lance Taylor wrote: > > Thanks. I think https://golang.org/cl/87137 will fix it. Committed as follows. Ian Index: gcc/go/gofrontend/MERGE === --- gcc/go/gofrontend/MERGE (revision

<    2   3   4   5   6   7   8   9   10   11   >