aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
AgeCommit message (Collapse)AuthorFilesLines
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
2019-02-01runtime: add hurd netpoll and semaphore supportIan Lance Taylor1-1/+1
Patch by Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/160827 From-SVN: r268465
2019-02-01runtime: add getproccount for hurdIan Lance Taylor1-1/+1
Patch by Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/160825 From-SVN: r268463
2019-02-01libgo: add configury and sysinfo support for hurdIan Lance Taylor1-1/+1
Patch by Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/160824 From-SVN: r268461
2019-02-01libgo: add hurd build tags to test filesIan Lance Taylor1-1/+1
Patch by Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/160823 From-SVN: r268460
2019-02-01libgo: add hurd build tagsIan Lance Taylor1-1/+1
Patch by Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/160822 From-SVN: r268459
2019-02-01runtime, sync: use __atomic intrinsics instead of __syncIan Lance Taylor1-1/+1
GCC has supported the __atomic intrinsics since 4.7. They are better than the __sync intrinsics in that they specify a memory model and, more importantly for our purposes, they are reliably implemented either in the compiler or in libatomic. Fixes https://gcc.gnu.org/PR52084 Reviewed-on: https://go-review.googlesource.com/c/160820 From-SVN: r268458
2019-02-01compiler: support alias to pointer type as receiver in method declarationIan Lance Taylor2-1/+9
Fixes golang/go#27994. Reviewed-on: https://go-review.googlesource.com/c/160459 From-SVN: r268450
2019-01-30compiler: support alias to pointer type as method receiverIan Lance Taylor2-1/+5
Fixes golang/go#28252. Reviewed-on: https://go-review.googlesource.com/c/160077 From-SVN: r268397
2019-01-29runtime: fix sigprof frame countingIan Lance Taylor1-1/+1
If sigtramp and sigtrampgo are both on stack, n -= framesToDiscard is executed twice, which should actually run only once. Reviewed-on: https://go-review.googlesource.com/c/159238 From-SVN: r268366
2019-01-29runtime: use the call instruction's PC for panic-in-runtime detectionIan Lance Taylor1-1/+1
If a panic happens in the runtime we turn that into a fatal error. We use the caller's PC to determine if the panic call is inside the runtime. getcallerpc returns the PC immediately after the call instruction. If the call is the very last instruction of a function, it may not find this PC belong to a runtime function, giving false result. We need to back off the PC by 1 to the call instruction. The gc runtime doesn't do this because the gc compiler always emit an instruction following a panic call, presumably an UNDEF instruction which turns into an architecture-specific illegal instruction. Our compiler doesn't do this. Reviewed-on: https://go-review.googlesource.com/c/159437 From-SVN: r268358
2019-01-28compiler: improve recursive type detectionIan Lance Taylor2-1/+10
Detect recursive type definition like "type T0 T1; type T1 T2; ...... type Tn T0". Fixes golang/go#25320. Reviewed-on: https://go-review.googlesource.com/c/159837 From-SVN: r268347
2019-01-24runtime: install SIGURG handler on C created threadsIan Lance Taylor1-1/+1
Precise stack scan uses SIGURG to trigger a stack scan. We need to have Go signal handler installed for SIGURG. Reviewed-on: https://go-review.googlesource.com/c/159097 From-SVN: r268230
2019-01-22golang.org/x/tools/go/analysis: pass "gccgo" to types.SizesForIan Lance Taylor1-1/+1
For the gofrontend copy, change calls to types.SizesFor to pass "gccgo" rather than "gc". Leave the asmdecl pass unchanged since that pass is gc-specific anyhow. This has been fixed in a better way in the external repo by https://golang.org/cl/158317 and friends, but that is not in 1.12, so use this approach for now. Reviewed-on: https://go-review.googlesource.com/c/158842 From-SVN: r268153
2019-01-22re PR go/88927 (Bootstrap failure on arm in libgo starting with r268084)Ian Lance Taylor1-1/+1
PR go/88927 runtime, internal/cpu: fix build for ARM GNU/Linux Was failing with ../../../libgo/go/internal/cpu/cpu.go:138:2: error: reference to undefined name 'doinit' 138 | doinit() | ^ Fix it by adding in Go 1.12 internal/cpu/cpu_arm.go, and the code in runtime that initializes the values. Fixes https://gcc.gnu.org/PR88927. Reviewed-on: https://go-review.googlesource.com/c/158717 From-SVN: r268131
2019-01-21libgo: fix building, and some testing, on SolarisIan Lance Taylor1-1/+1
Restore some of the fixes that were applied to golang_org/x/net/lif but were lost when 1.12 moved the directory to internal/x/net/lif. Add support for reading /proc to fetch argc/argv/env for c-archive mode. Reviewed-on: https://go-review.googlesource.com/c/158640 From-SVN: r268130
2019-01-21compiler: stop iterator on errorIan Lance Taylor2-1/+2
If there is an error reading or parsing an archive header, the Archive_iterator code would return a dummy header but would not mark itself as done. The effect is that an invalid archive leads to an endless loop reading and re-reading the same archive header. Avoid that by setting the offset to the end of the file, which will cause the iterator to == archive_end. No test since it doesn't seem worth constructing an invalid archive. Reviewed-on: https://go-review.googlesource.com/c/158217 From-SVN: r268129
2019-01-18libgo: update to Go1.12beta2Ian Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/c/158019 gotools/: * Makefile.am (go_cmd_vet_files): Update for Go1.12beta2 release. (GOTOOLS_TEST_TIMEOUT): Increase to 600. (check-runtime): Export LD_LIBRARY_PATH before computing GOARCH and GOOS. (check-vet): Copy golang.org/x/tools into check-vet-dir. * Makefile.in: Regenerate. gcc/testsuite/: * go.go-torture/execute/names-1.go: Stop using debug/xcoff, which is no longer externally visible. From-SVN: r268084
2019-01-18re PR go/88202 (FAIL: runtime/pprof)Ian Lance Taylor1-1/+1
PR go/88202 runtime: in sigprof, skip to sigtrampgo if we don't find sigtramp Fixes https://gcc.gnu.org/PR88202 Reviewed-on: https://go-review.googlesource.com/c/158218 From-SVN: r268057
2019-01-17runtime: dropg before CAS g status to _Grunnable/_GwaitingIan Lance Taylor1-1/+1
Currently, we dropg (which clears gp.m) after we CAS the g status to _Grunnable or _Gwaiting. Immediately after CASing the g status, another thread may CAS it to _Gscan status and scan its stack. With precise stack scan, it accesses gp.m in order to switch to g and back (in doscanstackswitch). This races with dropg. If doscanstackswitch reads gp.m, then dropg runs, when we restore the m at the end of the scan it will set to a stale value. Worse, if dropg runs after doscanstackswitch sets the new m, gp will be running with a nil m. To fix this, we do dropg before CAS g status to _Grunnable or _Gwaiting. We can do this safely if we are CASing from _Grunning, as we own the g when it is in _Grunning. There is one case where we CAS from _Gsyscall to _Grunnable. It is not safe to dropg when it is in _Gsyscall, as precise stack scan needs to read gp.m in order to signal the m. So we need to introduce a transient state, _Gexitingsyscall, between _Gsyscall and _Grunnable, where the GC should not scan its stack. In is a little unfortunate that we have to add another g status. We could reuse an existing one (e.g. _Gcopystack), but it is clearer and safer to just use a new one, as Austin suggested. Reviewed-on: https://go-review.googlesource.com/c/158157 From-SVN: r268001
2019-01-16syscall: mark C syscall functions noescapeIan Lance Taylor1-1/+1
Many C syscall functions take pointer arguments. The pointers don't escape in the C functions. Mark the C functions noescape so calling them doesn't need allocation. Reviewed-on: https://go-review.googlesource.com/c/158158 From-SVN: r267989
2019-01-15runtime: add padding to FFI type of struct ending with zero-sized fieldIan Lance Taylor1-1/+1
CL 157557 changes the compiler to add one byte padding to non-empty struct ending with a zero-sized field. Add the same padding to the FFI type, so reflect.Call works. This fixes test/fixedbugs/issue26335.go in the main repo. Reviewed-on: https://go-review.googlesource.com/c/158018 From-SVN: r267956
2019-01-15compiler, runtime: panic on uncomparable map key, even if map is emptyIan Lance Taylor3-25/+61
This ports https://golang.org/cl/155918 from the master repo. runtime: panic on uncomparable map key, even if map is empty Reorg map flags a bit so we don't need any extra space for the extra flag. This is a pre-req for updating libgo to the Go 1.12beta2 release. Reviewed-on: https://go-review.googlesource.com/c/157858 From-SVN: r267950
2019-01-11compiler: pad structs ending with zero-sized fieldIan Lance Taylor4-11/+46
For a struct with zero-sized last field, the address of the field falls out of the object boundary, which confuses the garbage collector. Pad an extra byte in this case. Reviewed-on: https://go-review.googlesource.com/c/157557 From-SVN: r267861
2019-01-09re PR go/86343 (types built by GO share TYPE_FIELDS in unsupported way)Ian Lance Taylor2-1/+12
PR go/86343 * go-gcc.cc (Gcc_backend::set_placeholder_struct_type): Go back to build_distinct_type_copy, but copy the fields so that they have the right DECL_CONTEXT. From-SVN: r267789
2019-01-09PR other/16615 [1/5]Sandra Loosemore3-3/+10
2019-01-09 Sandra Loosemore <sandra@codesourcery.com> PR other/16615 [1/5] contrib/ * mklog: Mechanically replace "can not" with "cannot". gcc/ * Makefile.in: Mechanically replace "can not" with "cannot". * alias.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * common/config/i386/i386-common.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/alpha/sync.md: Likewise. * config/arc/arc.c: Likewise. * config/arc/predicates.md: Likewise. * config/arm/arm-c.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm.h: Likewise. * config/arm/arm.md: Likewise. * config/arm/cortex-r4f.md: Likewise. * config/csky/csky.c: Likewise. * config/csky/csky.h: Likewise. * config/darwin-f.c: Likewise. * config/epiphany/epiphany.md: Likewise. * config/i386/i386.c: Likewise. * config/i386/sol2.h: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.h: Likewise. * config/microblaze/microblaze.md: Likewise. * config/mips/20kc.md: Likewise. * config/mips/sb1.md: Likewise. * config/nds32/nds32.c: Likewise. * config/nds32/predicates.md: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/e300c2c3.md: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.h: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/spu/vmx2spu.h: Likewise. * cprop.c: Likewise. * dbxout.c: Likewise. * df-scan.c: Likewise. * doc/cfg.texi: Likewise. * doc/extend.texi: Likewise. * doc/fragments.texi: Likewise. * doc/gty.texi: Likewise. * doc/invoke.texi: Likewise. * doc/lto.texi: Likewise. * doc/md.texi: Likewise. * doc/objc.texi: Likewise. * doc/rtl.texi: Likewise. * doc/tm.texi: Likewise. * dse.c: Likewise. * emit-rtl.c: Likewise. * emit-rtl.h: Likewise. * except.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fold-const.c: Likewise. * genautomata.c: Likewise. * gimple-fold.c: Likewise. * hard-reg-set.h: Likewise. * ifcvt.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-fnsummary.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * ira.h: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-out.c: Likewise. * postreload-gcse.c: Likewise. * predict.c: Likewise. * profile-count.h: Likewise. * profile.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * symtab.c: Likewise. * target.def: Likewise. * toplev.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-core.h: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-profile.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phionlycprop.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssanames.c: Likewise. * tree-streamer-out.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * vr-values.c: Likewise. gcc/ada/ * exp_ch9.adb: Mechanically replace "can not" with "cannot". * libgnat/s-regpat.ads: Likewise. * par-ch4.adb: Likewise. * set_targ.adb: Likewise. * types.ads: Likewise. gcc/cp/ * cp-tree.h: Mechanically replace "can not" with "cannot". * parser.c: Likewise. * pt.c: Likewise. gcc/fortran/ * class.c: Mechanically replace "can not" with "cannot". * decl.c: Likewise. * expr.c: Likewise. * gfc-internals.texi: Likewise. * intrinsic.texi: Likewise. * invoke.texi: Likewise. * io.c: Likewise. * match.c: Likewise. * parse.c: Likewise. * primary.c: Likewise. * resolve.c: Likewise. * symbol.c: Likewise. * trans-array.c: Likewise. * trans-decl.c: Likewise. * trans-intrinsic.c: Likewise. * trans-stmt.c: Likewise. gcc/go/ * go-backend.c: Mechanically replace "can not" with "cannot". * go-gcc.cc: Likewise. gcc/lto/ * lto-partition.c: Mechanically replace "can not" with "cannot". * lto-symtab.c: Likewise. * lto.c: Likewise. gcc/objc/ * objc-act.c: Mechanically replace "can not" with "cannot". libbacktrace/ * backtrace.h: Mechanically replace "can not" with "cannot". libgcc/ * config/c6x/libunwind.S: Mechanically replace "can not" with "cannot". * config/tilepro/atomic.h: Likewise. * config/vxlib-tls.c: Likewise. * generic-morestack-thread.c: Likewise. * generic-morestack.c: Likewise. * mkmap-symver.awk: Likewise. libgfortran/ * caf/single.c: Mechanically replace "can not" with "cannot". * io/unit.c: Likewise. libobjc/ * class.c: Mechanically replace "can not" with "cannot". * objc/runtime.h: Likewise. * sendmsg.c: Likewise. liboffloadmic/ * include/coi/common/COIResult_common.h: Mechanically replace "can not" with "cannot". * include/coi/source/COIBuffer_source.h: Likewise. libstdc++-v3/ * include/ext/bitmap_allocator.h: Mechanically replace "can not" with "cannot". From-SVN: r267783
2019-01-09compiler: use int type for len & cap in slice valueIan Lance Taylor2-3/+5
Slice value expression has backend type a struct of a pointer and two ints. Make sure the len and cap are converted to int when creating slice value expression. Reviewed-on: https://go-review.googlesource.com/c/156897 From-SVN: r267745
2019-01-07runtime: in doscanstackswitch, set gp->m before gogoIan Lance Taylor1-1/+1
This is following CL 156038. doscanstackswitch uses the same mechanism of switching goroutines as getTraceback, and so has the same problem as described in issue golang/go#29448. This CL applies the same fix. Reviewed-on: https://go-review.googlesource.com/c/156697 From-SVN: r267661
2019-01-07compiler: move slice construction to callers of makesliceIan Lance Taylor6-86/+161
This is the gccgo version of https://golang.org/cl/141822: Only return a pointer p to the new slices backing array from makeslice. Makeslice callers then construct sliceheader{p, len, cap} explictly instead of makeslice returning the slice. This change caused the GCC backend to break the runtime/pprof test by merging together the identical functions allocateReflectTransient and allocateTransient2M. This caused the traceback to be other than expected. Fix that by making the functions not identical. This is a step toward updating libgo to the Go1.12beta1 release. Reviewed-on: https://go-review.googlesource.com/c/155937 From-SVN: r267660
2019-01-07runtime: in getTraceback, set gp->m before gogoIan Lance Taylor1-1/+1
Currently, when collecting a traceback for another goroutine, getTraceback calls gogo(gp) switching to gp, which will resume in mcall, which will call gtraceback, which will set up gp->m. There is a gap between setting the current running g to gp and setting gp->m. If a profiling signal arrives in between, sigtramp will see a non-nil gp with a nil m, and will seg fault. Fix this by setting up gp->m first. Fixes golang/go#29448. Reviewed-on: https://go-review.googlesource.com/c/156038 From-SVN: r267658
2019-01-05runtime: prevent deadlock when profiling signal arrives during tracebackIan Lance Taylor1-1/+1
Traceback routines, e.g. callers and funcentry, may call __go_get_backtrace_state. If a profiling signal arrives while we are in the critical section of __go_get_backtrace_state, it tries to do a traceback, which also calls __go_get_backtrace_state, which tries to enter the same critical section and will deadlock. Prevent this deadlock by setting up runtime_in_callers before calling __go_get_backtrace_state. Found while investigating golang/go#29448. Will add a test in the next CL. Updates golang/go#29448. Reviewed-on: https://go-review.googlesource.com/c/156037 From-SVN: r267590