Граф коммитов

2852 Коммитов

Автор SHA1 Сообщение Дата
Ian Lance Taylor 47380f733c libgo: update to Go1.18beta2
Change-Id: Icfd17aa29159d126329cdda72835f0d89e95e32e
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/384695
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2022-02-11 20:24:59 +00:00
Ian Lance Taylor b0dcd2d1e5 compiler: don't warn for print()
We used to warn for calls to print(), because it doesn't do anything.
However, a Go 1.18 test uses that call, and it is valid Go.  Change
the compiler to just accept it and compile it; this will produce calls
to printlock and printunlock, and nothing else.

Change-Id: I11710ae38478d1860cf8e2708bec8b0f7e1b8373
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/384355
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2022-02-09 22:15:31 +00:00
Ian Lance Taylor 263e8d2a2a compiler: use nil pointer for zero length string constant
We used to pointlessly set the pointer of a zero length string
constant to point to a zero byte constant.  Instead, just use nil.

Change-Id: I73fb28dcfcf547565dcab4ec26412f6e6e7ca951
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/384354
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-02-09 22:13:09 +00:00
Ian Lance Taylor 7dffb933d3 compiler: treat notinheap types as not being pointers
By definition, a type is marked notinheap doesn't contain any pointers
that the garbage collector cares about, and neither does a pointer to
such a type.  Change the type descriptors to consistently treat such
types as not being pointers, by setting ptrdata to 0 and gcdata to nil.

Change-Id: Id8466555ec493456ff5ff09f1670551414619bd2
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/384118
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-02-09 22:09:55 +00:00
Ian Lance Taylor 3b1e46937d compiler: recognize Go 1.18 runtime/internal/atomic methods
The Go 1.18 library introduces specific types in runtime/internal/atomic.
Recognize and optimize the methods on those types, as we do with the
functions in runtime/internal/atomic.

While we're here avoid getting confused by methods in any other
package that we recognize specially.

Change-Id: I75c31f75dcf65ce13f3c69022e8ec36e05eab994
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/383654
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-02-09 04:10:59 +00:00
Ian Lance Taylor 262cb89fd5 compiler, internal/abi: implement FuncPCABI0, FuncPCABIInternal
The Go 1.18 standard library uses an internal/abi package with two
functions that are implemented in the compiler. This patch implements
them in the gofrontend, to support the upcoming update to 1.18.

Change-Id: I645f0c65ccf18646b212f23add94a618843bff7c
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/383514
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-02-09 04:07:25 +00:00
Ian Lance Taylor 61f7cf4b9d compiler: accept "any" as an alias for "interface{}"
For golang/go#33232

Change-Id: I9c2f073982bce22179de552b52e9e5285153e21e
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/382248
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2022-02-05 00:42:23 +00:00
Ian Lance Taylor 7d510bf5fc runtime: build panic32.go on amd64p32
Fixes https://gcc.gnu.org/PR104149

Change-Id: Ie5062c66cceb753dd918e173062bf23813237967
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/380054
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2022-01-21 03:06:00 +00:00
Ian Lance Taylor 799e9807c3 compiler: permit converting unnamed types when ignoring struct tags
Test case is https://golang.org/cl/375796.

Fixes golang/go#50439

Change-Id: I2c77b456cccb706a77710ccb3963d4e10d387cc4
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/375797
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-01-06 19:23:25 +00:00
Ian Lance Taylor 9732b07666 compiler: remove duplication of Named_object traversal
Adding type parameters was about to add a partial third version.
Remove the duplication to avoid that.

Change-Id: I0f9ca818c9ff030520690c085d9651681b2dae32
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/375234
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2022-01-05 00:19:10 +00:00
Ian Lance Taylor d3be41f0a1 compiler, libgo: don't pad sparc64-linux epollevent
Change the compiler to not add zero padding because of zero-sized
fields named "_", since those can't be referenced anyhow.

Change the sparc-linux64 epollevent struct to name the alignment
field "_", to avoid zero padding.

Fixes https://gcc.gnu.org/PR103847

Change-Id: I591b3b798a24141e3d0e1ccf6ff0f7f0570af9d4
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/374914
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-12-29 23:49:39 +00:00
Ian Lance Taylor 3e9f4ee166 compiler: traverse func subexprs when creating func descriptors
Fix the Create_func_descriptors pass to traverse the subexpressions of
the function in a Call_expression.  There are no subexpressions in the
normal case of calling a function a method directly, but there are
subexpressions when in code like F().M() when F returns an interface type.

Forgetting to traverse the function subexpressions was almost entirely
hidden by the fact that we also created the necessary thunks in
Bound_method_expression::do_flatten and
Interface_field_reference_expression::do_get_backend.  However, when
the thunks were created there, they did not go through the
order_evaluations pass.  This almost always worked, but failed in the
case in which the function being thunked returned multiple results, as
order_evaluations takes the necessary step of moving the
Call_expression into its own statement, and that would not happen when
order_evaluations was not called.  Avoid hiding errors like this by
changing those methods to only lookup the previously created thunk,
rather than creating it if it was not already created.

The test case for this is https://golang.org/cl/363156.

Fixes golang/go#49512

Change-Id: I6b273156f16ed6ed22e600097628a1cb6499de64
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/363274
Trust: Ian Lance Taylor <iant@golang.org>
Trust: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-11-11 20:21:03 +00:00
Ian Lance Taylor 128ea3dce9 compiler: permit compiler directives in parenthesized groups
The original compiler directive support was only for //line at the
start of a line and for //go: comments before function declarations.
When support was added for //go:notinheap for types and //go:embed for
variables the code did not adapt to permit spaces before the comment
or to permit the comments in var() or type() groups.  This change
corrects those omissions.

Change-Id: I0d533a7f13d33115dca1eab842a24f6f294df09d
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/358699
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-26 23:10:30 +00:00
Than McIntosh 925ace70ac compiler: workaround for C++ build template matching quirk
Tweak a couple of places in the types code to use nullptr instead of
NULL to work around a template matching quirk when using certain build
compilers.

Change-Id: Ia349c998a7dd90b4c2df589c7ceeaedcee6cde01
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/354151
Trust: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-10-05 22:05:37 +00:00
Ian Lance Taylor bbc1effb1a compiler: avoid calling Expression::type before lowering
This is a minor cleanup to ensure that the various Expression::do_type
methods don't have to worry about the possibility that the Expression
has not been lowered.

Change-Id: I4c255b6b126617931ff961f0f7fd4691a9828d67
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/353140
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-09-30 18:46:18 +00:00
Ian Lance Taylor e3bfc08892 runtime: set runtime.GOROOT value at build time
In Go 1.17 the gc toolchain changed to set runtime.GOROOT in cmd/link
(previously it was runtime/internal/sys.GOROOT).  Do the same in libgo.

Change-Id: Ia684a17fbb8f436d05afbcce14fc63fd16353be2
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/351313
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-09-21 21:26:45 +00:00
Ian Lance Taylor 850235e4b9 libgo: update to go1.17.1 release
Change-Id: I0e0a1f749c54738cbe18af2c44b731d249e60135
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/350414
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-09-16 23:47:20 +00:00
Ian Lance Taylor c11d9f8275 compiler: don't pad zero-sized trailing field in results struct
Nothing can take the address of that field anyhow.

Fixes https://gcc.gnu.org/PR101994

Change-Id: Ie3add79739278ce9d715398f2c4c4dfaef8a293a
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/343873
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-09-11 21:19:22 +00:00
Ian Lance Taylor 21b30eddc5 compiler: correct condition for calling memclrHasPointers
When compiling append(s, make([]typ, ln)...), where typ has a pointer,
and the append fits within the existing capacity of s, the condition
used to clear out the new elements was reversed.

Fixes golang/go#47771

Change-Id: Ia880adc08ab723afe3f927e65c9e081f9f717f90
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/344189
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-09-10 18:12:48 +00:00
Ian Lance Taylor e42c7c0216 runtime: use hash32, not hash64, for amd64p32, mips64p32, mips64p32le
Fixes https://gcc.gnu.org/PR102102

Change-Id: I4831424eb8b238edef01d91eb1e40b2b9a192e01
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/348015
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-09-07 22:02:40 +00:00
Ian Lance Taylor b3fad6957a libgo: update to final Go 1.17 release
Change-Id: I8cac79c01f3086294c40bfe5568ca13b3c4558da
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/343729
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-09-05 23:10:02 +00:00
Ian Lance Taylor 77bc32767b libgo: various fixes for Solaris support
Change-Id: I1208e3576525af8b33438feca52b1a02f59d047d
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/342189
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-15 00:34:09 +00:00
Ian Lance Taylor f2b7a2ce94 runtime: use C cast syntax in stack.c
Didn't notice earlier because this code is only used on systems that
do not support -fsplit-stack.

Change-Id: I101f91b67a09526867c940fe33a0778d0f7f6be4
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/342051
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-13 17:37:53 +00:00
Ian Lance Taylor 33f65dce43 libgo: update to Go1.17rc2
Change-Id: If08df4a2f7e2cc7dadc64c9b722d38dbd9ccf785
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341629
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-13 00:04:34 +00:00
Ian Lance Taylor 5edbb624b2 compiler: store pointers to go:notinheap types indirectly
This is the gofrontend version of https://golang.org/cl/264480.

For golang/go#42076

Change-Id: Ic8949fe5f052438a2858aae938eb9941dbd7c27c
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/340609
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-08-12 23:32:33 +00:00
Ian Lance Taylor 7e092d2cc5 compiler: don't crash on a, b := int(0)
Fixes https://gcc.gnu.org/PR101851

Change-Id: I15d372bc4919f84156151993aa2fe5cfa3d8afae
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341330
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-11 02:35:02 +00:00
Ian Lance Taylor d5d51242ef compiler: support export/import of unsafe.Add/Slice
For golang/go#19367
For golang/go#40481

Change-Id: Id1aefd0696131842d480d9f9a5330c5ab221245a
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/340549
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-07 20:37:02 +00:00
Cherry Mui 747f3a2d78 compiler: make escape analysis more strict about runtime calls
Following the previous CL, in the escape analysis list all the
expected runtime calls, and fail if an unexpected one is seen.

Change-Id: I2847141c7bebb4b3daee930d862cb3cf5b83db60
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/340397
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-08-06 19:37:07 +00:00
Ian Lance Taylor 32590102c4 runtime: extend internal atomics to comply with sync/atomic
This is the gofrontend version of https://golang.org/cl/289152.

Change-Id: I28e231e7a72e3d2d05af6b03ae4aed4d7e5f431e
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/339690
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-05 18:41:07 +00:00
Cherry Mui b47bcf942d compiler: make escape analysis more robust about builtin functions
In the places where we handle builtin functions, list all
supported ones, and fail if an unexpected one is seen. So if a
new builtin function is added in the future we can detect it,
instead of silently treating it as nonescaping.

Change-Id: Ia5efc4a51edf677c5c619ff5894bb5374d021763
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/339992
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-08-05 04:23:12 +00:00
Cherry Mui 616ee658a6 compiler: support new language constructs in escape analysis
Previous CLs add new language constructs in Go 1.17, specifically,
unsafe.Add, unsafe.Slice, and conversion from a slice to a pointer
to an array. This CL handles them in the escape analysis.

At the point of the escape analysis, unsafe.Add and unsafe.Slice
are still builtin calls, so just handle them in data flow.
Conversion from a slice to a pointer to an array has already been
lowered to a combination of compound expression, conditional
expression and slice info expressions, so handle them in the
escape analysis.

Change-Id: Iccac4f0135f2bd6081ca93707db1c7b608350052
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/339671
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-08-04 01:31:14 +00:00
Ian Lance Taylor 2031f0be9c compile, runtime: make selectnbrecv return two values
The only different between selectnbrecv and selectnbrecv2 is the later
set the input pointer value by second return value from chanrecv.

So by making selectnbrecv return two values from chanrecv, we can get
rid of selectnbrecv2, the compiler can now call only selectnbrecv and
generate simpler code.

This is the gofrontend version of https://golang.org/cl/292890.

Change-Id: Ied87c4ab6c36e48669aeba22cbbb80a34d99d3d7
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/339529
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-03 23:39:46 +00:00
Ian Lance Taylor 54361805bd compiler: check slice to pointer-to-array conversion element type
When checking a slice to pointer-to-array conversion, I forgot to
verify that the elements types are identical.

For golang/go#395

Change-Id: I533ac52c0b390af96fce78a8c468ae9d8ad79da9
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/339329
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-03 23:35:32 +00:00
Ian Lance Taylor 0a4d612e6b compiler, runtime: allow slice to array pointer conversion
Panic if the slice is too short.

For golang/go#395

Change-Id: I184f87d0207dcee4be6b36ae446b84e9583b356d
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/338630
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-02 22:26:19 +00:00
Ian Lance Taylor ad667e7c70 compiler, runtime: support unsafe.Add and unsafe.Slice
For golang/go#19367
For golang/go#40481

Change-Id: I989d042a518a38fd24c0d14f9c78ae564e5799a2
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/338949
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-08-02 20:55:21 +00:00
Ian Lance Taylor 920549b638 compiler: avoid aliases in receiver types
If a package declares a method on an alias type, the alias would be
used in the export data.  This would then trigger a compiler
assertion on import: we should not be adding methods to aliases.

Fix the problem by ensuring that receiver types do not use alias types.
This seems preferable to consistently avoiding aliases in export data,
as aliases can cross packages.  And it's painful to try to patch this
while writing the export data, as at that point all the types are known.

Test case is https://golang.org/cl/335172.

Fixes golang/go#47131

Change-Id: Ic1fa7feddc3ff19c22c5c112bc06236b8c9d010a
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/335729
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-07-19 23:46:19 +00:00
Ian Lance Taylor adcf108908 runtime: remove direct assignments to memory locations
They cause a warning with the updated GCC -Warray-bounds option.
Replace them with calls to abort, which for our purposes is fine.

For GCC PR bootstrap/101374

Change-Id: Ie3232c44ab5730b548b87e5fc73d78f44ce92c26
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/333409
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-07-10 02:47:16 +00:00
Ian Lance Taylor 01cb2b5e69 compiler: don't generate temporaries for composite literals
We were generating temporaries for composite literals when a
conversion to interface type was required.  However, Cherry's
https://golang.org/cl/176459 changed the compiler to insert explicit
type conversions.  And those explicit type conversions insert the
required temporaries in Type_conversion_expression::do_flatten.
So in practice the composite literal do_flatten methods would never
insert temporaries, as the values they see would always be multi_eval_safe.
So just remove the unnecessary do_flatten methods.

Change-Id: I66975b7ddc763f0cf93a6b56efede10bca3d3765
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/331691
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-06-29 20:43:22 +00:00
Ian Lance Taylor cad187fe3a compiler: in composite literals use temps only for interfaces
For a composite literal we only need to introduce a temporary variable
if we may be converting to an interface type, so only do it then.
This saves over 80% of compilation time when using gccgo to compile
cmd/internal/obj/x86, as the GCC middle-end spends a lot of time
pointlessly computing interactions between temporary variables.

For golang/go#46600

Change-Id: I6f01a3c84762b9d06268c5304af6ffce14a0a031
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/331513
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-06-29 17:59:30 +00:00
Ian Lance Taylor bcafcb3c39 libgo: update to Go1.16.5 release
Change-Id: Id10234101018f844e48d8061f3f2e785b45363d6
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/326772
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-06-10 21:40:17 +00:00
Avelino eb92460630 README.md: convert README to markdown
Change-Id: Iaf3365ca1940abcba170ba64ff0ee109768d261b
GitHub-Last-Rev: d18e9457f2
GitHub-Pull-Request: golang/gofrontend#5
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/323316
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
2021-06-08 22:29:21 +00:00
Ian Lance Taylor 5a801b1569 compiler: mark global variables whose address is taken
To implement this, change the backend to use flag bits for variables.

Fixes https://gcc.gnu.org/PR100537

Change-Id: I19d803ec3d13003361ea7331cc04297294ec0b8a
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/322129
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-05-24 20:19:41 +00:00
Ian Lance Taylor 38228e7a91 libgo: update libtool.m4 to support GNU/Hurd
This patch was incorrectly installed in the GCC repo:
https://gcc.gnu.org/pipermail/gcc-patches/2021-January/562758.html

Change-Id: I12766baf02bfdf2233f1c5bde1a270f06b020aa7
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/321076
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-05-19 02:57:36 +00:00
Cherry Mui a0864e90c6 CONTRIBUTORS: change my name
Change-Id: Ic27adceb7c390c8a06c8d8662309fff5281857e7
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/317893
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-05-07 22:16:14 +00:00
Ian Lance Taylor 9782e85bef libgo: update to Go1.16.3 release
Change-Id: I5f73fa30d5e5865f59b7eb00204c6e5d7661fe21
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/309490
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-04-12 22:22:28 +00:00
Ian Lance Taylor 4bdff733a0 compiler: copy receiver argument for go/defer of method call
Test case is https://golang.org/cl/302371.

Change-Id: I7b18afadee66e65b16afe840e83a5860a197b7fa
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/302270
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-03-17 19:17:16 +00:00
Ian Lance Taylor 10b00ad873 libgo: update to Go 1.16.2 release
Change-Id: Ic12711a34cc086df02c47888361522ad8e740261
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/301459
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-03-15 21:52:09 +00:00
Ian Lance Taylor 2f281eb24e misc/cgo/testcarchive: don't use == for string equality in C code
Backport of https://golang.org/cl/300993.

For https://gcc.gnu.org/PR99553

Change-Id: I42727f024af36103435646e58aca013ace6e1581
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/301458
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-03-13 04:05:58 +00:00
Ian Lance Taylor bf35249a7c compiler: create temporaries for heap variables
The compiler generally doesn't create a temporary for an expression
that is a variable, because it's normally valid to simply reload the
value from the variable.  However, if the variable is in the heap,
then loading the value is a pointer indirection.  The process of
creating GCC IR can cause the variable load and the pointer
indirection to be split, such that the second evaluation only does the
pointer indirection.  If there are conditionals in between the two
uses, this can cause the second use to load the pointer from an
uninitialized register.

Avoid this by introducing a new Expression method that returns whether
it is safe to evaluate an expression multiple times, and use it
everywhere.

The test case is https://golang.org/cl/300789.

Fixes golang/go#44383

Change-Id: Ice2a18153457daa024ddbf0a9935f7863fe6818e
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/300809
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-03-11 23:47:20 +00:00
Ian Lance Taylor 93380a9126 runtime: cast SIGSTKSZ to uintptr
In newer versions of glibc it is long, which causes a signed
comparison warning.

Fixes https://gcc.gnu.org/PR99458

Change-Id: I9fca4a971455a1361f5435d0ecb80e1a5096486c
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/299849
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-03-08 22:26:22 +00:00