Age | Commit message (Collapse) | Author | Files | Lines |
|
This patch is an addendum to the fix for issue 34577, which was not
sufficiently general. During export data processing, when looking at
the types of constants mentioned in inlinable function bodies, include
both locally defined constants and constant imported from other
packages.
Testcase for this bug is in CL 201017.
Fixes golang/go#34852.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/201018
From-SVN: r276976
|
|
Patch from Andreas Krebbel.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/201038
From-SVN: r276964
|
|
Patch from Andreas Krebbel.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/201037
From-SVN: r276962
|
|
We need to mangle dots to avoid problems with -fgo-pkgpath=a.0.
That will confuse the name mangling, which assumes that names
entering the mangling cannot contain arbitrary dot characters.
We don't need to mangle other characters; go_encode_id will handle them.
Fixes golang/go#33871
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/200838
From-SVN: r276913
|
|
The machinery that collects types referenced by expressions that are
part of inlinable function bodies was missing the types of local named
constants in certain cases. This patch updates the
Collect_export_references::expression() hook to look for references to
local named constants and include their types in the exported set.
Fixes golang/go#34577.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/198017
From-SVN: r276594
|
|
Also add a couple of missing calls to free after mpz_get_str.
This should make the code clean with respect to -Wshadow=local.
Based on patch by Bernd Edlinger.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/198837
From-SVN: r276579
|
|
The .note.GNU-stack section tells the linker that this object does not
require an executable stack.
The .note.GNU-split-stack section tells the linker that functions in
this object can be called directly by split-stack functions, without
require a large stack.
The .note.GNU-no-split-stack section tells the linker that functions
in this object do not have a split-stack prologue.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/198440
From-SVN: r276488
|
|
Also use just one table lookup, not two.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/197759
From-SVN: r276382
|
|
Tweak the exporter for inlinable function bodies to work around a
problem with importing of function calls whose function expressions
are not simple function names. In the bug in question, the function
body exporter was writing out a function call of the form
(*(*FuncTyp)(var))(arg)
which produced an export data representation of
*$convert(<type 5>, var)(x)
which is hard to parse unambiguously. Fix: change the export data
emitter to introduce parens around the function expression for more
complex calls.
Testcase for this bug is in CL 197217.
Fixes golang/go#34503.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/197122
From-SVN: r276228
|
|
With the current export format, if we already know the type, we don't
have to read and parse the definition.
We only use the finalizer in Import::finalize_methods, so make it a
local variable. To match Finalize_methods::type, only put struct
types into real_for_named.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/197700
From-SVN: r276188
|
|
Fetching the size of a type typically involves a hash table lookup,
and is generally non-trivial. The escape analysis code calls is_big
more than one might expect. So only fetch the size if we need it.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/197699
From-SVN: r276187
|
|
Just happened to notice this one.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/197698
From-SVN: r276186
|
|
This CL serves as part of an initial change for enabling gollvm
building on arm64 linux, the rest of the change will be covered by
another one to the gollvm repo.
Incorporate type definition of 'uint128' to 'runtime' and 'syscall'
packges, the change is not specific to arm64 linux but made available
for all platforms.
Verified by building and unit-testing gollvm on linux x86-64 and arm64.
Verified by building and checking gccgo on linux x86-64 and arm64.
Fixes golang/go#33711
Change-Id: I4720c7d810cfd4ef720962fb4104c5641b2459c0
From-SVN: r275919
|
|
This only matters on systems that pass a struct with a single pointer
field differently than passing a single pointer. I noticed it on
32-bit PPC, where the reflect package TestDirectIfaceMethod failed.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/195878
From-SVN: r275814
|
|
PR go/91781
reflect: promote integer closure return to full word
The libffi library expects an integer return type to be promoted to a
full word. Implement that when returning from a closure written in Go.
This only matters on big-endian systems when returning an integer smaller
than the pointer size, which is why we didn't notice it until now.
Fixes https://gcc.gnu.org/PR91781.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/195858
From-SVN: r275813
|
|
The function was always intended to be internal-only, but was exported
so that C code could call it. Now that have go:linkname for that, use it.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/195857
From-SVN: r275809
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/195718
From-SVN: r275758
|
|
It's not supported by Solaris grep. Just use * instead; it matches
more but it shouldn't matter.
Fixes https://gcc.gnu.org/PR91764
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/195238
From-SVN: r275700
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194698
From-SVN: r275691
|
|
Change Named_object::get_backend to ignore aliases when creating type
descriptors for types, to be consistent with
Type::needs_specific_type_functions and the Specific_type_functions
traversal class. For example, when compiling a package that creates an
alias to an an externally defined type, e.g.
import "foo"
type MyFoo = foo.Foo
it makes sense to skip the alias (not try to generate type specific
functions for it) and let the normal mechanisms take care of the alias
target, depending on whether the target is defined locally or defined
elsewhere.
Testcase for this problen can be found in CL 193261.
Fixes golang/go#33866.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191961
From-SVN: r275651
|
|
Should fix the build on riscv64 and other systems.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194641
From-SVN: r275650
|
|
When compiling the x_test package, force the test package to be
imported first. That ensures that we will see the types defined in
the test package before the types defined in the non-test version of
the package. This matters if the types differ in some way, such as by
adding a new method.
This avoids a failure in internal/poll on Solaris, in which the test
package adds a method to a type (FD.EOFError). I think it was Solaris-
specific because files are sorted in a different order by default.
The go tool handles this kind of thing correctly, by rebuilding
dependent packages. This is just a hack sufficient to run the libgo
testsuite without using the go tool.
Fixes https://gcc.gnu.org/PR91712
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194637
From-SVN: r275648
|
|
Restore Solaris compatibility fixes lost when internal/x/net/lif moved
to golang.org/x/net/lif. Also fix the Makefile for x/net/lif and
x/net/route.
Change x/sys/cpu to get the cache line size from goarch.sh as the
gofrontend version of internal/cpu does.
Partially based on work by Rainer Orth.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194438
From-SVN: r275611
|
|
PR go/91621
mksysinfo: change test == to test =
Fixes https://gcc.gnu.org/PR91621
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194569
From-SVN: r275608
|
|
Backport of https://golang.org/cl/194440. Original description:
If an embedded field refers to a type via a pointer, the parser needs
to know the name of the embedded field. It is possible that the
pointer type is not yet resolved. This CL fixes the parser to handle
that case by setting the pointer element type to the unresolved named
type while the pointer is being resolved.
Updates golang/go#34182
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194562
From-SVN: r275606
|
|
Also fix the key used to store the ID.
This is a significant speedup in cmd/go run time.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194257
From-SVN: r275559
|
|
This relatively minor change increases the number of inlinable
functions/methods in the standard library from 983 to 2179.
In particular it permits inlining math/bits/RotateLeftNN. This
restores the speed of crypto/sha256 back to what it was before the
update to 1.13beta1.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194340
From-SVN: r275558
|
|
They were lost when the files were moved in the update to Go1.13beta1.
These changes should be made in the master repo for the 1.14 release,
as riscv64 support is added there.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194343
From-SVN: r275551
|
|
The C file has a build tag, but the procedure we use for building C
files ignores build tags.
This should fix the libgo build on non-x86 systems.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194378
From-SVN: r275544
|
|
For the main package we add an implicit import of the runtime package,
to ensure that it is initialized. That import used the predeclared
location, which caused various tests, notably Named_type::is_builtin,
to treat these imported names as builtin. Start using a real location,
so that those tests do the right thing.
By the way, this implicit import is a partial cause of golang/go#19773.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194337
From-SVN: r275540
|
|
We forgot to ever traverse types of constant expressions. This rarely
makes a difference--evidently, since nobody noticed--but it does
matter when we inline constant expressions: we need to ensure that the
type is visible to the importing code.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194317
From-SVN: r275539
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/193497
From-SVN: r275473
|
|
stack trace)
PR tree-optimization/91663
* go-lang.c (go_langhook_post_options): Clear
flag_partial_inlining.
From-SVN: r275396
|
|
If we dot-import a package, we should only add an imported variable to
the package bindings if the variable is in the package being imported.
A test case for this is the 1.13 os package, in which ErrClosed and
friends are defined both locally and in the imported internal/oserror package.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192718
From-SVN: r275358
|
|
When generating write barriers, we were only checking for a notinheap
struct at the outermost struct. That mishandled the case of setting a
pointer to a notinheap struct as a field of another struct that is not
notinheap. This caused an invalid write barrier error when building
the 1.13 version of the runtime.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192279
From-SVN: r275240
|
|
The gc compiler has started permitting go:linkname comments with a
single argument to mean that a function should be externally visible
outside the package. Implement this in the Go frontend.
Change the libgo runtime package to use it, rather than repeating the
name just to export a function.
Remove a couple of unnecessary go:linkname comments on declarations.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192197
From-SVN: r275239
|
|
If we get errors during compilation, we skip the escape analysis pass.
If we are compiling the runtime package, we report an error if a bound
method expression escapes. The effect is that if we get an error
while compiling the runtime package, we would report confusing and
meaningless errors about bound method expressions escaping.
This CL stops doing that.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192720
From-SVN: r275238
|
|
Avoids problems with arm64 ILP32 mode. We might want to handle that
mode better in general, but always building panic32.go is simple and
fixes the build.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192723
From-SVN: r275237
|
|
Permit putting structs with anonymous and empty fields in the C header
file runtime.inc that is used to build the C runtime code. This is
required for upcoming 1.13 support, as the m struct has picked up an
anonymous field.
Doing this lets the C header contain all the type descriptor structs,
so start using those in the C code. This cuts the number of copies of
type descriptor definitions from 3 to 2.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192343
From-SVN: r275227
|
|
This is a step toward updating libgo to 1.13. This adds the 1.13
version of the osinit function to Go code, and removes the
corresponding code from the C runtime. This should simplify future updates.
Some additional 1.13 code was brought in to simplify this change.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191717
From-SVN: r275010
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192037
From-SVN: r275000
|
|
This implements https://golang.org/cl/161477 in the gofrontend.
Updates golang/go#30116
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191881
From-SVN: r274998
|
|
The Makefile was missing a dependency.
Also remove runtime.inc.raw in mostlyclean.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191958
From-SVN: r274956
|
|
This change extends the work in https://golang.org/cl/51131 to include
placeholder pointer types created for Go function types, which can
also be left dangling/unresolved in some instances. This fixes an
assert in Llvm_backend::materializeComposite.
Test case can be found in https://golang.org/cl/191743.
Updates golang/go#33020.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191744
From-SVN: r274935
|
|
Record when a local pointer variable is set to a value such that
indirecting through the pointer does not require a write barrier. Use
that to eliminate write barriers when indirecting through that local
pointer variable. Only keep this information per-block, so it's not
all that applicable.
This reduces the number of write barriers generated when compiling the
runtime package from 553 to 524.
The point of this is to eliminate a bad write barrier in the bytes
function in runtime/print.go. Mark that function nowritebarrier so
that the problem does not recur.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191581
From-SVN: r274890
|
|
PR middle-end/91283
* common.opt (fexcess-precision=): Add Optimization flag. Use
flag_excess_precision variable instead of
flag_excess_precision_cmdline.
* flags.h (class target_flag_state): Remove x_flag_excess_precision
member.
(flag_excess_precision): Don't define.
* langhooks.c (lhd_post_options): Set flag_excess_precision instead of
flag_excess_precision_cmdline. Remove comment.
* opts.c (set_fast_math_flags): Use frontend_set_flag_excess_precision
and x_flag_excess_precision instead of
frontend_set_flag_excess_precision_cmdline and
x_flag_excess_precision_cmdline.
(fast_math_flags_set_p): Use x_flag_excess_precision instead of
x_flag_excess_precision_cmdline.
* toplev.c (init_excess_precision): Remove.
(lang_dependent_init_target): Don't call it.
ada/
* gcc-interface/misc.c (gnat_post_options): Set flag_excess_precision
instead of flag_excess_precision_cmdline.
brig/
* brig-lang.c (brig_langhook_post_options): Set flag_excess_precision
instead of flag_excess_precision_cmdline.
c-family/
* c-common.c (c_ts18661_flt_eval_method): Use flag_excess_precision
instead of flag_excess_precision_cmdline.
* c-cppbuiltin.c (c_cpp_flt_eval_method_iec_559): Likewise.
* c-opts.c (c_common_post_options): Likewise.
d/
* d-lang.cc (d_post_options): Set flag_excess_precision instead of
flag_excess_precision_cmdline.
fortran/
* options.c (gfc_post_options): Set flag_excess_precision instead of
flag_excess_precision_cmdline. Remove comment.
go/
* go-lang.c (go_langhook_post_options): Set flag_excess_precision
instead of flag_excess_precision_cmdline.
lto/
* lto-lang.c (lto_post_options): Set flag_excess_precision instead of
flag_excess_precision_cmdline. Remove comment.
From-SVN: r274850
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191040
From-SVN: r274803
|
|
Fixes golang/go#33739
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191037
From-SVN: r274800
|
|
Shifting by signed types is a new language feature in Go 1.13.
This requires a patch to the testsuite.
Updates golang/go#19113
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/190977
* go.test/test/fixedbugs/bug073.go: Update for language changes.
From-SVN: r274755
|
|
Add new hooks for dumping named objects, package bindings,
and top level Gogo package list.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/190877
From-SVN: r274682
|