Age | Commit message (Collapse) | Author | Files | Lines |
|
The gccgo runtime is never stale, and on a system with gc sources in
~/go the test may wind up checking whether the gc runtime is stale.
Reviewed-on: https://go-review.googlesource.com/102282
From-SVN: r258865
|
|
Also add noinst_DATA to CHECK_DEPS; it's not needed in practice since
`make` will build noinst_DATA, but it's logically required and will
make a difference if any of the noinst_DATA sources change between
`make` and `make check`.
Tony Reix figured out why omitting packages from noinst_DATA didn't
seem to matter: because if gccgo can't find foo.gox, it will fall back
to reading the export data in foo.o, and foo.o will exist because
these packages go into libgo.a.
Reviewed-on: https://go-review.googlesource.com/101077
From-SVN: r258606
|
|
Tested by installing the gcc-locales package and running
LANG=de_DE.utf8 go build hello.go
Without this change, that fails, as described at
https://gcc.gnu.org/PR84765.
Reviewed-on: https://go-review.googlesource.com/100737
From-SVN: r258565
|
|
Makefile: add internal/trace to noinst_DATA
The internal/trace package is only imported by tests (specifically the
tests in runtime/trace) so it must be in noinst_DATA to ensure that it
is built before running the tests.
This was mostly working because internal/trace has tests itself, and
is listed in check-packages.txt before runtime/trace, so typical
invocations of make would build internal/trace for checking purposes
before checking runtime/trace. But we need this change to make that
reliable.
Reviewed-on: https://go-review.googlesource.com/99836
From-SVN: r258392
|
|
Reviewed-on: https://go-review.googlesource.com/99117
From-SVN: r258337
|
|
This implements the same choices made in the gc runtime, except that
for 32-bit x86 we only use the fence instruction if the processor
supports SSE2.
The code here is hacked up for speed; the gc runtime uses straight
assembler.
Reviewed-on: https://go-review.googlesource.com/97715
From-SVN: r258336
|
|
Fix a small typo in the mksysinfo.sh script (incorrect input
file for a grep command).
Reviewed-on: https://go-review.googlesource.com/98635
From-SVN: r258259
|
|
The compiler was crashing partway through emitting an error for a bad
self-referential struct type (which refers to one of its own fields
via an unsafe.Offset expression). Tweak the offset logic to check for
this class of type error and exit cleanly.
Fixes golang/go#24180
Reviewed-on: https://go-review.googlesource.com/97855
From-SVN: r258112
|
|
Reviewed-on: https://go-review.googlesource.com/97357
From-SVN: r258052
|
|
Reviewed-on: https://go-review.googlesource.com/97517
From-SVN: r258051
|
|
We want to track references to fields in the real struct, not in
aliases to the struct.
Reviewed-on: https://go-review.googlesource.com/96816
From-SVN: r257954
|
|
Copy the idea of https://golang.org/cl/92756 to funcfileline, which is
used by runtime.FuncForPC, runtime.(*Frames).Next, and others.
Reviewed-on: https://go-review.googlesource.com/96175
From-SVN: r257913
|
|
Fixes https://gcc.gnu.org/PR84484
Reviewed-on: https://go-review.googlesource.com/95436
From-SVN: r257911
|
|
Let a fast syscall return be a preemption point. This helps with
tight loops that make system calls, as in BenchmarkSyscallExcessWork.
Reviewed-on: https://go-review.googlesource.com/94895
From-SVN: r257848
|
|
Aliases are supposed to be identical to the type being aliased, so
questions about type compatibility need to always ignore aliases,
except for error messages involving the type name.
The test case for this is https://golang.org/cl/94995.
Fixes golang/go#23912
Reviewed-on: https://go-review.googlesource.com/94996
From-SVN: r257845
|
|
In particular this lets BenchmarkPingPongHog in runtime/proc_test.go
complete.
Reviewed-on: https://go-review.googlesource.com/94735
From-SVN: r257743
|
|
They aren't needed, and could potentially cause unlikely symbol name
collisions. Also, the runtime package's reference to main could cause
the runtime package to define main.main..f, which could also be
defined in the main package if it does something like fmt.Print(main).
That will normally work but will fail with a multiple symbol
definition error when using -static-libgo.
Reviewed-on: https://go-review.googlesource.com/93656
From-SVN: r257637
|
|
Long long long ago Go permitted writing
func F()
in one file and writing
func F() {}
in another file. This was removed from the language, and that is now
considered to be a multiple definition error. Gccgo never caught up
to that, and it has been permitting this invalid code for some time.
Stop permitting it, so that we give correct errors. Since we've
supported it for a long time, the compiler uses it in a couple of
cases: it predeclares the hash/equal methods if it decides to create
them while compiling another function, and it predeclares main.main as
a mechanism for getting the right warning if a program uses the wrong
signature for main. For simplicity, keep those existing uses.
This required a few minor changes in libgo which were relying,
unnecessarily, on the current behavior.
Reviewed-on: https://go-review.googlesource.com/93083
From-SVN: r257600
|
|
PR go/84215
runtime, sync/atomic: use write barrier for atomic pointer functions
This copies atomic_pointer.go from 1.10rc2. It was omitted during the
transition of the runtime from C to Go, and I forgot about it.
This may help with https://gcc.gnu.org/PR84215.
Reviewed-on: https://go-review.googlesource.com/93197
From-SVN: r257599
|
|
The magic //go:nointerface comment, used for field tracking, was only
implemented for conversions to interface types in the same package.
Record it in the export data, so that it works as expected for types
imported from a different package.
Reviewed-on: https://go-review.googlesource.com/93075
From-SVN: r257540
|
|
If we trace back through code that has no debug info, as when calling
through C code compiled with -g0, we won't have a function name.
Try to fetch the function name using the symbol table.
Adding the test case revealed that gotest failed to use the gccgo tag
when matching files, so add that.
Reviewed-on: https://go-review.googlesource.com/92756
From-SVN: r257495
|
|
Reviewed-on: https://go-review.googlesource.com/92736
From-SVN: r257493
|
|
The escape analysis support is not yet good enough to avoid escaping
the argument to funcPC. This causes unnecessary and often harmful
memory allocation. E.g., (*cpuProfile).addExtra can be called from a
signal handler, and it must not allocate memory.
Move the calls to funcPC to use variables instead. This was done in
the original migration to using funcPC, but was not done for newer code.
In one case, in signal handling code, use getSigtramp.
Reviewed-on: https://go-review.googlesource.com/92735
From-SVN: r257463
|
|
Normally we ensure to build a single Btype for identical types.
We did not do this for methods table of identical interface
types, however. If there are two identical interface type I, I2,
they have the same Btype BI, but different Btypes for their
methods tables, BM and BM2. From the backend's point of view
only one of them is linked to BI. This can cause inconsitency
in the backend's type system, like unresolved placeholder. This
CL ensures we create a single Btype for methods table of
identical interface type.
Reviewed-on: https://go-review.googlesource.com/92436
From-SVN: r257436
|
|
Check for negative numbers with very small magnitudes that will round
to negative zero, and force them to positive zero instead.
This implements the spec clarification in https://golang.org/cl/14727.
The test is in https://golang.org/cl/91895.
Fixes golang/go#12621
Reviewed-on: https://go-review.googlesource.com/92175
From-SVN: r257415
|
|
The offset field in structfield has changed to offsetAnon, and now
requires a shift to get the actual offset value.
Fixes golang/go#23391
Reviewed-on: https://go-review.googlesource.com/92275
From-SVN: r257413
|
|
It uses functions that are not available in MPFR 2.4.2, which is the
current version supported by GCC.
Original change description:
compiler: avoid negative zero in float constants
Check for negative numbers with very small magnitudes that will round
to negative zero, and force them to positive zero instead.
This implements the spec clarification in https://golang.org/cl/14727.
The test is in https://golang.org/cl/91895.
Fixes golang/go#12621
Updates golang/go#12621
Reviewed-on: https://go-review.googlesource.com/92055
From-SVN: r257393
|
|
Check for negative numbers with very small magnitudes that will round
to negative zero, and force them to positive zero instead.
This implements the spec clarification in https://golang.org/cl/14727.
The test is in https://golang.org/cl/91895.
Fixes golang/go#12621
Reviewed-on: https://go-review.googlesource.com/91915
From-SVN: r257390
|
|
CL 71750 changed the definition of how iota works. This patch updates
gccgo for the new definition.
We've been mishandling iota appearing in a type that appears in a
const expression, as in `c = len([iota]int{})`. Correct that by copying
type expressions when we copy an expression. For simplicity only copy
when it can change the size of a type, as that is the only case where
iota in a type can affect the value of a constant (I think). This is
still a bunch of changes, but almost all boilerplate.
Fixes golang/go#22341
Reviewed-on: https://go-review.googlesource.com/91475
From-SVN: r257379
|
|
The language spec permits empty statements after a fallthrough
statement, so implement that. Also give a better error message when a
fallthrough statement is in the wrong place. The test case for this
is in the master repository, test/fixedbugs/issue14540.go, just not
yet in the gccgo repository.
Fixes golang/go#14538
Reviewed-on: https://go-review.googlesource.com/91855
From-SVN: r257378
|
|
The last change was incomplete, in that it did not evaluate the array
argument in some cases where it had to be evaluated. This reuses the
existing code for checking whether len/cap is constant.
Also clean up the use of _ as the second variable in a for/range,
which was previously inconsistent depending on whether the statement
used = or :=.
Updates golang/go#22313
Reviewed-on: https://go-review.googlesource.com/91715
From-SVN: r257377
|
|
This implements a requirement of the language spec.
While we're here fix the value returned by the type method of a
builtin call expression to make, although this doesn't seem to make
any difference anywhere since we lower this to a runtime call before
the determine_types pass anyhow.
There is already a test for this error in the master repository:
test/fixedbugs/issue16949.go. It just hasn't made it into the gccgo
testsuite yet.
Fixes golang/go#16949
Reviewed-on: https://go-review.googlesource.com/91697
From-SVN: r257376
|
|
We should only issue an error for a goto over a var declaration.
The test case for this is already in the master repository, at
test/fixedbugs/issue8042.go. It just hasn't been copied into the
gccgo repository yet.
Fixes golang/go#19089
Reviewed-on: https://go-review.googlesource.com/91696
From-SVN: r257375
|
|
We used to mishandle `select { case (<-c): }` and friends.
The test case for this is https://golang.org/cl/91657.
Fixes golang/go#20923
Reviewed-on: https://go-review.googlesource.com/91695
From-SVN: r257374
|
|
The quoting code that read _cgo_flags, currently only in the gccgo
version of cmd/go, was losing the last flag read from the file.
Fixes golang/go#23666
Reviewed-on: https://go-review.googlesource.com/91655
From-SVN: r257373
|
|
structural equality.
* go-gcc.cc (Gcc_backend::fill_in_struct): Mark struct types as
using structural equality.
From-SVN: r257357
|
|
* go-gcc.cc (Gcc_backend::type_size): Return 0 for
void_type_node.
(Gcc_backend::convert_expression): Don't convert if the type of
expr_tree is void_type_node.
(Gcc_backend::array_index_expression): Don't index if the type of
the array expression is void_type_node.
(Gcc_backend::init_statement): Don't initialize if the type of the
initializer expression is void_type_node.
(Gcc_backend::assignment_statement): Don't assign if the type of
either the left or right hand side is void_type_node.
(Gcc_backend::temporary_variable): Don't initialize if the type of
the initializer expression is void_type_node.
From-SVN: r257334
|
|
The language spec says that in `for i = range x`, in which there is no
second iteration variable, if len(x) is constant, then x is not
evaluated. This only matters when x is an expression that panics but
whose type is an array type; in such a case, we should not evaluate x,
since len of any array type is a constant.
Fixes golang/go#22313
Reviewed-on: https://go-review.googlesource.com/91555
From-SVN: r257330
|
|
They were disabled due to the lack of escape analysis. Now that
we have escape analysis, unskip these tests.
Reviewed-on: https://go-review.googlesource.com/86248
From-SVN: r257324
|
|
On ia64, a separate stack is used for saving/restoring register frames,
occupying the other end of the stack mapping. This must also be scanned
for pointers into the heap.
Reviewed-on: https://go-review.googlesource.com/85276
From-SVN: r257323
|
|
The escape analysis now runs by default. It can be disabled with
the negative flag, -fno-go-optimize-allocs.
Reviewed-on: https://go-review.googlesource.com/86247
* lang.opt (fgo-optimize): Remove RejectNegative.
* go-c.h (go_enable_optimize): Update declaration to take value
argument.
* go-lang.c (go_langhook_handle_option): Pass value to
go_enable_optimize.
* gccgo.texi (Invoking gccgo): Update -fgo-optimize-allocs doc.
From-SVN: r257319
|
|
This matches the gc compiler.
The test case was sent for the master repo as
https://golang.org/cl/91138.
Fixes golang/go#23620
Reviewed-on: https://go-review.googlesource.com/91139
From-SVN: r257300
|
|
Otherwise on a 64-bit system we will read the 32-bit value as a 64-bit
value. Since getaddrinfo returns negative numbers as error values,
these will be interpreted as numbers like 0xfffffffe rather than -2,
and the comparisons with values like syscall.EAI_NONAME will fail.
Fixes golang/go#23645
Reviewed-on: https://go-review.googlesource.com/91296
From-SVN: r257299
|
|
We already dereference the pointer to copy the value, but if the
method does not use the value then the pointer dereference may be
optimized away. Do an explicit nil check so that we get the panic
that is required.
Fixes golang/go#19806
Reviewed-on: https://go-review.googlesource.com/91275
* go.go-torture/execute/printnil.go: New test.
From-SVN: r257280
|
|
Ensure that array types with complicated length expressions are
handled correctly by lowering expression types in the lowering pass.
This required some adjustment of constant expression types to not
report too many errors for circular constant expressions. We now
record error types in the Named_constant type. If we find the
circularity due to lowering the Named_constant, we use that location
for the error message; this retains the error location we used to use.
Fixes golang/go#23545
Reviewed-on: https://go-review.googlesource.com/91035
From-SVN: r257250
|
|
I forgot to update the name of the map[string]bool type descriptor
used in go-fieldtrack.c. This didn't cause any errors because it's a
weak symbol, and the current testsuite has no field tracking tests.
Reviewed-on: https://go-review.googlesource.com/91096
From-SVN: r257249
|
|
On AIX nm displays symbols with a leading dot; don't discard such
symbols.
While we're here stop doing fgrep -v '$', symbol names no longer
contain '$' anyhow.
Reviewed-on: https://go-review.googlesource.com/91095
From-SVN: r257247
|
|
On ppc64 gotest treats data variables whose names begin with "Test" as
tests to run. This is to support the function descriptors used for
ppc64 ELF ABI v1. This causes gotest to think that TestAddr6 is a
test, when it is actually a variable. For a simple fix until we can
figure out how to write gotest properly, rename the variable.
Fixes golang/go#23623
Reviewed-on: https://go-review.googlesource.com/90995
From-SVN: r257235
|
|
* go-gcc.cc (Gcc_backend::convert_tree): New private method.
(Gcc_backend::constructor_expression): Call it.
(Gcc_backend::assignment_statement): Likewise.
(Gcc_backend::temporary_variable): Likewise.
Fixes https://golang.org/issue/#23606
From-SVN: r257218
|
|
Function_type and Backend_function_type have different backend
representations, so they should not be identical. Otherwise it
confuses Type::type_btypes map.
Reviewed-on: https://go-review.googlesource.com/90975
From-SVN: r257216
|