From 3e8d2bb2eccdc1687608594bae06debe7f83fee3 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 26 Jun 2017 17:56:14 +0000 Subject: libgo: redefine ia64 struct names around linux/ptrace.h Avoid https://sourceware.org/bugzilla/show_bug.cgi?id=762. Patch by Andreas Schwab. Reviewed-on: https://go-review.googlesource.com/46711 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249662 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 416a5876da8..72d12b46ebc 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -0a20181d00d43a423c55f4e772b759fba0619478 +1b4c2bcaa96f7f40538fd8fff308ad92ea6f482e The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From c8efa6c97e5fcca72caed9e85ffd6cf48755842e Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 26 Jun 2017 17:59:12 +0000 Subject: syscall: don't define PtraceRegs for Alpha It's now defined by mksysinfo.sh. Patch by Uros Bizjak. Reviewed-on: https://go-review.googlesource.com/46712 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249663 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 72d12b46ebc..38f08feddf7 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -1b4c2bcaa96f7f40538fd8fff308ad92ea6f482e +bfb18fb16194826bf2bf2d7af873719ddb5e8e42 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From aaff1ad73c50b46e7cd2558d6c1b14f84000545f Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 27 Jun 2017 04:21:40 +0000 Subject: libgo: add misc/cgo files Copy all the misc/cgo files from the gc toolchain into libgo/misc. These will be used for testing purposes by later changes to the gotools directory. Reviewed-on: https://go-review.googlesource.com/46721 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249674 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 38f08feddf7..583d6032e93 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -bfb18fb16194826bf2bf2d7af873719ddb5e8e42 +040dc31406d580e33f82e578a840600fea5004ef The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 17e024614fa53f77bbaaee20b4f7568df199e0da Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 27 Jun 2017 21:51:50 +0000 Subject: syscall: ptrace fixes for s390 Fixes required now that we #include in sysinfo.c. Patch by Andreas Krebbel. Reviewed-on: https://go-review.googlesource.com/46839 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249712 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 583d6032e93..500ab5e2734 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -040dc31406d580e33f82e578a840600fea5004ef +63b766d67098877496a4b79d7f41e731fbe8abc8 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 809998537fd191430c36ad6c35ddcf958aa9afd8 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 27 Jun 2017 22:36:48 +0000 Subject: runtime: adapt memory management to AIX mmap On AIX: * mmap does not allow to map an already mapped range, * mmap range start at 0x30000000 for 32 bits processes, * mmap range start at 0x70000000_00000000 for 64 bits processes This is adapted from change 37845. Issue golang/go#19200 Reviewed-on: https://go-review.googlesource.com/46772 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249713 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 500ab5e2734..b52320bc4b0 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -63b766d67098877496a4b79d7f41e731fbe8abc8 +66d14d95a5a453682fe387319c80bc4fc40d96ad The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 08299f51748703023ced3ca5ec4d2442d001dd1a Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 29 Jun 2017 15:14:05 +0000 Subject: cmd/go: fix -buildmode={c-archive,c-shared,pie} for gccgo The tests are misc/cgo tests that are not currently run but will be run soon. Reviewed-on: https://go-review.googlesource.com/47037 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249794 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index b52320bc4b0..fb28b1a1c76 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -66d14d95a5a453682fe387319c80bc4fc40d96ad +8c4d6fd19f6d5dc9b41be384c60507f2236f05ec The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 7da758eea172fdea58314cee52784f54d945599d Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 29 Jun 2017 15:17:20 +0000 Subject: misc/cgo/testcarchive: fix test to work for gccgo This test is not yet run, but it will be soon. Reviewed-on: https://go-review.googlesource.com/47038 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249795 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index fb28b1a1c76..289383f929a 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -8c4d6fd19f6d5dc9b41be384c60507f2236f05ec +12c65e8310956eb3cc412d9dc9f9e88cbd928c8e The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 91ce5ca9646d1fd4079d2dab1ce5d8449f769a1b Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 13 Jul 2017 03:44:14 +0000 Subject: PR go/81393 syscall: don't use GETREGS/SETREGS on s390 They were removed in recent glibc. Patch by Andreas Krebbel for GCC PR 81393. Reviewed-on: https://go-review.googlesource.com/48231 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250174 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 289383f929a..efa2c018dfb 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -12c65e8310956eb3cc412d9dc9f9e88cbd928c8e +9294e79fced202ade7eb236bbe78b766e7e0374f The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 7eed4ce2070691ef3f04896f84d2edc89c6e277f Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 14 Jul 2017 22:21:37 +0000 Subject: cmd/go: use gccSupportsFlag for -fsplit-stack Don't assume that all (or only) 386/amd64 compilers support -fsplit-stack. Reviewed-on: https://go-review.googlesource.com/48592 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250216 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index efa2c018dfb..5c5602188da 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -9294e79fced202ade7eb236bbe78b766e7e0374f +a77b1091fa83cfaf200e6dad26e92e42483bae43 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From f3fc9ea479d06046d40442618e38d5d119a5bd47 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 14 Jul 2017 22:25:26 +0000 Subject: libgo: don't copy semt into runtime.inc https://gcc.gnu.org/PR81449 reports a problem with the definition semt in runtime.inc on some systems. Since the C code in libgo/runtime doesn't need semt, just don't copy it into runtime.inc. Reviewed-on: https://go-review.googlesource.com/48593 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250217 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 5c5602188da..524aca72fd7 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -a77b1091fa83cfaf200e6dad26e92e42483bae43 +2ae6bf76f97f7d4c63a1f0ad0683b9ba62baaf06 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From a680233188fd213fdd5b794fd44564f577796976 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 18 Jul 2017 22:06:31 +0000 Subject: PR go/81324 sysinfo.c: ignore ptrace_peeksiginfo_args from With some versions of glibc and GNU/Linux ptrace_pseeksiginfo_args is defined in both and . We don't actually care about the struct, so use a #define to avoid a redefinition error. This fixes https://gcc.gnu.org/PR81324. Reviewed-on: https://go-review.googlesource.com/49290 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250324 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 524aca72fd7..06a8731d06f 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -2ae6bf76f97f7d4c63a1f0ad0683b9ba62baaf06 +21775ae119830810d9e415a02e85349f4190c68c The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 85855de7c24aef222d44e3a9da5f0ded0059175b Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 18 Jul 2017 22:31:00 +0000 Subject: compiler: pass correct 'function' flag to circular_pointer_type The code in Named_type::do_get_backend was not passing the correct flag value for circular function types to Backend::circular_pointer_type (it was always setting this flag to false). Pass a true value if the type being converted is a function type. Reviewed-on: https://go-review.googlesource.com/49330 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250325 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/types.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 06a8731d06f..cc713791691 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -21775ae119830810d9e415a02e85349f4190c68c +0036bd04d077f8bbe5aa9a62fb8830c53068209e The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index b2756fde048..ca5f5121d36 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -10994,13 +10994,13 @@ Named_type::do_get_backend(Gogo* gogo) if (this->seen_in_get_backend_) { this->is_circular_ = true; - return gogo->backend()->circular_pointer_type(bt, false); + return gogo->backend()->circular_pointer_type(bt, true); } this->seen_in_get_backend_ = true; bt1 = Type::get_named_base_btype(gogo, base); this->seen_in_get_backend_ = false; if (this->is_circular_) - bt1 = gogo->backend()->circular_pointer_type(bt, false); + bt1 = gogo->backend()->circular_pointer_type(bt, true); if (!gogo->backend()->set_placeholder_pointer_type(bt, bt1)) bt = gogo->backend()->error_type(); return bt; -- cgit v1.2.1 From a0b34ba375e0a66530c886c44938679fb11ed0c0 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 18 Jul 2017 23:14:29 +0000 Subject: PR go/81451 runtime: inline runtime_osinit We had two identical copies of runtime_osinit. They set runtime_ncpu, a variable that is no longer used. Removing that leaves us with two lines. Inline those two lines in the two places the function was called. This fixes GCC PR 81451. Reviewed-on: https://go-review.googlesource.com/48862 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250326 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index cc713791691..0b110e02d63 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -0036bd04d077f8bbe5aa9a62fb8830c53068209e +c49ddc84f3ce89310585aad23ab6e51ef5523748 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 76818e19a747c6ad4eb1a9f0ab8df7b606595d1b Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 18 Jul 2017 23:29:15 +0000 Subject: compiler: insert backend type conversion for closure func ptr In Func_expression::do_get_backend when creating the backend representation for a closure, create a backend type conversion to account for potential differences between the closure struct type (where the number of fields is dependent on the number of values referenced in the closure) and the generic function descriptor type (struct with single function pointer field). Reviewed-on: https://go-review.googlesource.com/49255 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250327 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/expressions.cc | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 0b110e02d63..f6d7a002cbf 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -c49ddc84f3ce89310585aad23ab6e51ef5523748 +3d9ff9bc339942922f1be3bef07c6fe2978ad81a The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 12505b23939..597f0a0daef 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -1204,7 +1204,14 @@ Func_expression::do_get_backend(Translate_context* context) // expression. It is a pointer to a struct whose first field points // to the function code and whose remaining fields are the addresses // of the closed-over variables. - return this->closure_->get_backend(context); + Bexpression *bexpr = this->closure_->get_backend(context); + + // Introduce a backend type conversion, to account for any differences + // between the argument type (function descriptor, struct with a + // single field) and the closure (struct with multiple fields). + Gogo* gogo = context->gogo(); + Btype *btype = this->type()->get_backend(gogo); + return gogo->backend()->convert_expression(btype, bexpr, this->location()); } // Ast dump for function. -- cgit v1.2.1 From 21b70e8f0502827e1b81d5978873f41e26888c99 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 20 Jul 2017 19:53:54 +0000 Subject: compiler: add explicit convert in Type_guard_expression::do_get_backend The current recipe in Type_guard_expression for creating a Bexpression performs a type conversion at the Type level, but doesn't invoke Backend::convert_expression to capture the conversion for the back end. Add code to create a BE type conversion operation. Reviewed-on: https://go-review.googlesource.com/50373 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250400 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/expressions.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index f6d7a002cbf..5f624b4b795 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -3d9ff9bc339942922f1be3bef07c6fe2978ad81a +6572f7e35f962bdb8a7c174920dbb70350b96874 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 597f0a0daef..96a0731c222 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -14307,7 +14307,10 @@ Type_guard_expression::do_get_backend(Translate_context* context) Expression::convert_for_assignment(context->gogo(), this->type_, this->expr_, this->location()); - return conversion->get_backend(context); + Gogo* gogo = context->gogo(); + Btype* bt = this->type_->get_backend(gogo); + Bexpression* bexpr = conversion->get_backend(context); + return gogo->backend()->convert_expression(bt, bexpr, this->location()); } // Dump ast representation for a type guard expression. -- cgit v1.2.1 From adeed436f87465d4d406d6d8b14ab203bde06d23 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 21 Jul 2017 17:50:14 +0000 Subject: runtime: allocate more stack space in CgoCallbackGC test Allocate enough stack space so that the test will work on a system that does not support split stacks. This test is actually not very meaningful for gccgo at present, but it doesn't hurt to keep running it. Updates golang/go#20931 Reviewed-on: https://go-review.googlesource.com/50630 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250433 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 5f624b4b795..364312f2202 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -6572f7e35f962bdb8a7c174920dbb70350b96874 +e34cb8dee6c1f215329e0eea79202b48cb83817c The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 527223661a797d2f96dc2d0fbb651f1725b8ad90 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 21 Jul 2017 18:08:01 +0000 Subject: runtime: handle PPC/PPC64 GNU/Linux in getSiginfo Updates golang/go#20931 Reviewed-on: https://go-review.googlesource.com/50631 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250436 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 364312f2202..accb55f768e 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -e34cb8dee6c1f215329e0eea79202b48cb83817c +a9f1aeced86691de891fbf2a8c97e848faf1962e The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 5d4b7436925aee8275a6cefc7d136e9dce07d37b Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 21 Jul 2017 18:27:35 +0000 Subject: runtime: don't use runtime_lock in __go_get_backtrace_state If getSiginfo does not know how to determine the PC, it will call runtime_callers. That can happen in a thread that was started by non-Go code, in which case the TLS variable g will not be set, in which case runtime_lock will crash. Avoid the problem by using atomic operations for the lock. This is OK since creating a backtrace state is fast and never blocks. The test case is TestCgoExternalThreadSIGPROF in the runtime package on a system that getSiginfo doesn't handle specially. Updates golang/go#20931 Reviewed-on: https://go-review.googlesource.com/50650 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250439 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index accb55f768e..efb2dd474c1 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -a9f1aeced86691de891fbf2a8c97e848faf1962e +b712bacd939466e66972337744983e180849c535 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From a69c165a390ed1487ffbe9316b484e436cb35486 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 21 Jul 2017 20:25:13 +0000 Subject: syscall: call f?statfs64 on GNU/Linux We unconditionally set _FILE_OFFSET_BITS to 64 in configure.ac, so we should unconditionally call the statfs64 and fstatfs64 functions. These functions should be available on all versions of GNU/Linux since 2.6. On 64-bit systems they are aliased to statfs/fstatfs, and on 32-bit systems they use the 64-bit data structures. Fixes golang/go#20922 Reviewed-on: https://go-review.googlesource.com/50635 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250443 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index efb2dd474c1..4c0b827d66f 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -b712bacd939466e66972337744983e180849c535 +e1bd9ea4dc16e228164c92a12c5229ddf20f2b50 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 9b0818e352ae5eea0f7eee6671d16e9b2a46066f Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 25 Jul 2017 22:54:23 +0000 Subject: compiler: clean up unresolved placeholders for pointer types Add a new helper routine Type::finish_pointer_types that walks through the pointer type cache and looks for placeholder types that may have been created at some point before conversion of named types, and invokes Type::finish_backend() on said placeholders. This is needed to handle cases where the compiler manufactures a pointer type as part of lowering, then a placeholder is created for it due to a call to Type::backend_type_size(), but there is no explicit reference to the type in user code. Reviewed-on: https://go-review.googlesource.com/51131 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250548 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/gogo.cc | 2 ++ gcc/go/gofrontend/types.cc | 40 +++++++++++++++++++++++++++++++++++++--- gcc/go/gofrontend/types.h | 9 +++++++++ 4 files changed, 49 insertions(+), 4 deletions(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 4c0b827d66f..78905fe39c4 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -e1bd9ea4dc16e228164c92a12c5229ddf20f2b50 +61ce3b80ab20cb1f16960c1784bc0937abaa440a The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index a9d72ff4aa0..ca4b454a238 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -4824,6 +4824,8 @@ Gogo::convert_named_types() Runtime::convert_types(this); this->named_types_are_converted_ = true; + + Type::finish_pointer_types(this); } // Convert all names types in a set of bindings. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index ca5f5121d36..91d6091f544 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -5516,14 +5516,17 @@ Pointer_type::do_import(Import* imp) return Type::make_pointer_type(to); } +// Cache of pointer types. Key is "to" type, value is pointer type +// that points to key. + +Type::Pointer_type_table Type::pointer_types; + // Make a pointer type. Pointer_type* Type::make_pointer_type(Type* to_type) { - typedef Unordered_map(Type*, Pointer_type*) Hashtable; - static Hashtable pointer_types; - Hashtable::const_iterator p = pointer_types.find(to_type); + Pointer_type_table::const_iterator p = pointer_types.find(to_type); if (p != pointer_types.end()) return p->second; Pointer_type* ret = new Pointer_type(to_type); @@ -5531,6 +5534,37 @@ Type::make_pointer_type(Type* to_type) return ret; } +// This helper is invoked immediately after named types have been +// converted, to clean up any unresolved pointer types remaining in +// the pointer type cache. +// +// The motivation for this routine: occasionally the compiler creates +// some specific pointer type as part of a lowering operation (ex: +// pointer-to-void), then Type::backend_type_size() is invoked on the +// type (which creates a Btype placeholder for it), that placeholder +// passed somewhere along the line to the back end, but since there is +// no reference to the type in user code, there is never a call to +// Type::finish_backend for the type (hence the Btype remains as an +// unresolved placeholder). Calling this routine will clean up such +// instances. + +void +Type::finish_pointer_types(Gogo* gogo) +{ + for (Pointer_type_table::const_iterator i = pointer_types.begin(); + i != pointer_types.end(); + ++i) + { + Pointer_type* pt = i->second; + Type_btypes::iterator tbti = Type::type_btypes.find(pt); + if (tbti != Type::type_btypes.end() && tbti->second.is_placeholder) + { + pt->finish_backend(gogo, tbti->second.btype); + tbti->second.is_placeholder = false; + } + } +} + // The nil type. We use a special type for nil because it is not the // same as any other type. In C term nil has type void*, but there is // no such type in Go. diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h index aeb04d6c50f..f659f384845 100644 --- a/gcc/go/gofrontend/types.h +++ b/gcc/go/gofrontend/types.h @@ -504,6 +504,9 @@ class Type static Pointer_type* make_pointer_type(Type*); + static void + finish_pointer_types(Gogo* gogo); + static Type* make_nil_type(); @@ -1341,6 +1344,12 @@ class Type static Type_functions type_functions_table; + // Cache for reusing existing pointer types; maps from pointed-to-type + // to pointer type. + typedef Unordered_map(Type*, Pointer_type*) Pointer_type_table; + + static Pointer_type_table pointer_types; + // The type classification. Type_classification classification_; // The backend representation of the type, once it has been -- cgit v1.2.1 From 522e3c6b899a77621422f221cb12208ed820d8cf Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 26 Jul 2017 20:20:22 +0000 Subject: runtime: handle Alpha GNU/Linux in getSiginfo Patch by Uros Bizjak. Reviewed-on: https://go-review.googlesource.com/51370 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250588 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 78905fe39c4..722c0a1ab06 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -61ce3b80ab20cb1f16960c1784bc0937abaa440a +feb26fbb5065eadfe1f8610e9b74b3749a87c52d The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.2.1 From 647ec97750639db9f481ac4fd66d43729f8e5331 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 28 Jul 2017 00:16:36 +0000 Subject: * go-backend.c (go_write_export_data): Use EXCLUDE section for AIX. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250648 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/ChangeLog | 5 +++++ gcc/go/go-backend.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index ac0dbe3f99d..1925111f169 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,8 @@ +2017-07-27 Tony Reix + + * go-backend.c (go_write_export_data): Use EXCLUDE section for + AIX. + 2017-06-09 Ian Lance Taylor * go-lang.c (go_langhook_post_options): If -fsplit-stack is turned diff --git a/gcc/go/go-backend.c b/gcc/go/go-backend.c index 2f8d2f405da..21277ea2eb9 100644 --- a/gcc/go/go-backend.c +++ b/gcc/go/go-backend.c @@ -45,6 +45,10 @@ along with GCC; see the file COPYING3. If not see #define GO_EXPORT_SECTION_NAME ".go_export" #endif +#ifndef TARGET_AIX +#define TARGET_AIX 0 +#endif + /* This file holds all the cases where the Go frontend needs information from gcc's backend. */ @@ -101,7 +105,9 @@ go_write_export_data (const char *bytes, unsigned int size) if (sec == NULL) { gcc_assert (targetm_common.have_named_sections); - sec = get_section (GO_EXPORT_SECTION_NAME, SECTION_DEBUG, NULL); + sec = get_section (GO_EXPORT_SECTION_NAME, + TARGET_AIX ? SECTION_EXCLUDE : SECTION_DEBUG, + NULL); } switch_to_section (sec); -- cgit v1.2.1 From 5731103c14d9676c2821fbea321434c02594a253 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 28 Jul 2017 17:42:05 +0000 Subject: compiler: use a single temporary for calls with multiple results For calls that return multiple results we used to create a temporary of struct type to hold the results, and also create a separate temporary for each result. Then the call expression would copy each result out of the struct to the temporary, and Call_result_expression would refer to the desired temporary. Simplify this to just use a single temporary of struct type, and change Call_result_expression to fetch a field of the struct. This may reduce some incorrect tree sharing in the backend code. Reviewed-on: https://go-review.googlesource.com/51770 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250682 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/expressions.cc | 175 ++++++++++++--------------------------- gcc/go/gofrontend/expressions.h | 18 ++-- 3 files changed, 60 insertions(+), 135 deletions(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 722c0a1ab06..1c649cb6ca9 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -feb26fbb5065eadfe1f8610e9b74b3749a87c52d +27804ec53590e3644e030c9860822139a0cfb03f The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 96a0731c222..79a2f524aa7 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -9463,24 +9463,28 @@ Call_expression::do_lower(Gogo* gogo, Named_object* function, this->is_varargs_, loc); // If this call returns multiple results, create a temporary - // variable for each result. - size_t rc = this->result_count(); - if (rc > 1 && this->results_ == NULL) + // variable to hold them. + if (this->result_count() > 1 && this->call_temp_ == NULL) { - std::vector* temps = - new std::vector; - temps->reserve(rc); + Struct_field_list* sfl = new Struct_field_list(); + Function_type* fntype = this->get_function_type(); const Typed_identifier_list* results = fntype->results(); + Location loc = this->location(); + + int i = 0; + char buf[20]; for (Typed_identifier_list::const_iterator p = results->begin(); - p != results->end(); - ++p) - { - Temporary_statement* temp = Statement::make_temporary(p->type(), - NULL, loc); - inserter->insert(temp); - temps->push_back(temp); - } - this->results_ = temps; + p != results->end(); + ++p, ++i) + { + snprintf(buf, sizeof buf, "res%d", i); + sfl->push_back(Struct_field(Typed_identifier(buf, p->type(), loc))); + } + + Struct_type* st = Type::make_struct_type(sfl, loc); + st->set_is_struct_incomparable(); + this->call_temp_ = Statement::make_temporary(st, NULL, loc); + inserter->insert(this->call_temp_); } // Handle a call to a varargs function by packaging up the extra @@ -9779,30 +9783,6 @@ Call_expression::do_flatten(Gogo* gogo, Named_object*, this->args_ = args; } - size_t rc = this->result_count(); - if (rc > 1 && this->call_temp_ == NULL) - { - Struct_field_list* sfl = new Struct_field_list(); - Function_type* fntype = this->get_function_type(); - const Typed_identifier_list* results = fntype->results(); - Location loc = this->location(); - - int i = 0; - char buf[20]; - for (Typed_identifier_list::const_iterator p = results->begin(); - p != results->end(); - ++p, ++i) - { - snprintf(buf, sizeof buf, "res%d", i); - sfl->push_back(Struct_field(Typed_identifier(buf, p->type(), loc))); - } - - Struct_type* st = Type::make_struct_type(sfl, loc); - st->set_is_struct_incomparable(); - this->call_temp_ = Statement::make_temporary(st, NULL, loc); - inserter->insert(this->call_temp_); - } - return this; } @@ -9827,17 +9807,18 @@ Call_expression::result_count() const return fntype->results()->size(); } -// Return the temporary which holds a result. +// Return the temporary that holds the result for a call with multiple +// results. Temporary_statement* -Call_expression::result(size_t i) const +Call_expression::results() const { - if (this->results_ == NULL || this->results_->size() <= i) + if (this->call_temp_ == NULL) { go_assert(saw_errors()); return NULL; } - return (*this->results_)[i]; + return this->call_temp_; } // Set the number of results expected from a call expression. @@ -10191,8 +10172,21 @@ Call_expression::interface_method_function( Bexpression* Call_expression::do_get_backend(Translate_context* context) { + Location location = this->location(); + if (this->call_ != NULL) - return this->call_; + { + // If the call returns multiple results, make a new reference to + // the temporary. + if (this->call_temp_ != NULL) + { + Expression* ref = + Expression::make_temporary_reference(this->call_temp_, location); + return ref->get_backend(context); + } + + return this->call_; + } Function_type* fntype = this->get_function_type(); if (fntype == NULL) @@ -10202,7 +10196,6 @@ Call_expression::do_get_backend(Translate_context* context) return context->backend()->error_expression(); Gogo* gogo = context->gogo(); - Location location = this->location(); Func_expression* func = this->fn_->func_expression(); Interface_field_reference_expression* interface_method = @@ -10323,91 +10316,28 @@ Call_expression::do_get_backend(Translate_context* context) fn_args, bclosure, location); - if (this->results_ != NULL) + if (this->call_temp_ != NULL) { - Bexpression* bcall_ref = this->call_result_ref(context); - Bstatement* assn_stmt = - gogo->backend()->assignment_statement(bfunction, - bcall_ref, call, location); + // This case occurs when the call returns multiple results. - this->call_ = this->set_results(context); + Expression* ref = Expression::make_temporary_reference(this->call_temp_, + location); + Bexpression* bref = ref->get_backend(context); + Bstatement* bassn = gogo->backend()->assignment_statement(bfunction, + bref, call, + location); - Bexpression* set_and_call = - gogo->backend()->compound_expression(assn_stmt, this->call_, - location); - return set_and_call; + ref = Expression::make_temporary_reference(this->call_temp_, location); + this->call_ = ref->get_backend(context); + + return gogo->backend()->compound_expression(bassn, this->call_, + location); } this->call_ = call; return this->call_; } -// Return the backend representation of a reference to the struct used -// to capture the result of a multiple-output call. - -Bexpression* -Call_expression::call_result_ref(Translate_context* context) -{ - go_assert(this->call_temp_ != NULL); - Location location = this->location(); - Expression* call_ref = - Expression::make_temporary_reference(this->call_temp_, location); - Bexpression* bcall_ref = call_ref->get_backend(context); - return bcall_ref; -} - -// Set the result variables if this call returns multiple results. - -Bexpression* -Call_expression::set_results(Translate_context* context) -{ - Gogo* gogo = context->gogo(); - - Bexpression* results = NULL; - Location loc = this->location(); - - go_assert(this->call_temp_ != NULL); - - size_t rc = this->result_count(); - for (size_t i = 0; i < rc; ++i) - { - Temporary_statement* temp = this->result(i); - if (temp == NULL) - { - go_assert(saw_errors()); - return gogo->backend()->error_expression(); - } - Temporary_reference_expression* ref = - Expression::make_temporary_reference(temp, loc); - ref->set_is_lvalue(); - - Bfunction* bfunction = context->function()->func_value()->get_decl(); - Bexpression* result_ref = ref->get_backend(context); - Bexpression* bcall_ref = this->call_result_ref(context); - Bexpression* call_result = - gogo->backend()->struct_field_expression(bcall_ref, i, loc); - Bstatement* assn_stmt = - gogo->backend()->assignment_statement(bfunction, - result_ref, call_result, loc); - - bcall_ref = this->call_result_ref(context); - call_result = gogo->backend()->struct_field_expression(bcall_ref, i, loc); - Bexpression* result = - gogo->backend()->compound_expression(assn_stmt, call_result, loc); - - if (results == NULL) - results = result; - else - { - Bstatement* expr_stmt = - gogo->backend()->expression_statement(bfunction, result); - results = - gogo->backend()->compound_expression(expr_stmt, results, loc); - } - } - return results; -} - // Dump ast representation for a call expressin. void @@ -10528,13 +10458,14 @@ Call_result_expression::do_get_backend(Translate_context* context) go_assert(this->call_->is_error_expression()); return context->backend()->error_expression(); } - Temporary_statement* ts = ce->result(this->index_); + Temporary_statement* ts = ce->results(); if (ts == NULL) { go_assert(saw_errors()); return context->backend()->error_expression(); } Expression* ref = Expression::make_temporary_reference(ts, this->location()); + ref = Expression::make_field_reference(ref, this->index_, this->location()); return ref->get_backend(context); } diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index a144ff4168b..0c742fd92df 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -2115,8 +2115,8 @@ class Call_expression : public Expression Call_expression(Expression* fn, Expression_list* args, bool is_varargs, Location location) : Expression(EXPRESSION_CALL, location), - fn_(fn), args_(args), type_(NULL), results_(NULL), call_(NULL), - call_temp_(NULL), expected_result_count_(0), is_varargs_(is_varargs), + fn_(fn), args_(args), type_(NULL), call_(NULL), call_temp_(NULL) + , expected_result_count_(0), is_varargs_(is_varargs), varargs_are_lowered_(false), types_are_determined_(false), is_deferred_(false), is_concurrent_(false), issued_error_(false), is_multi_value_arg_(false), is_flattened_(false) @@ -2144,11 +2144,11 @@ class Call_expression : public Expression size_t result_count() const; - // Return the temporary variable which holds result I. This is only - // valid after the expression has been lowered, and is only valid - // for calls which return multiple results. + // Return the temporary variable that holds the results. This is + // only valid after the expression has been lowered, and is only + // valid for calls which return multiple results. Temporary_statement* - result(size_t i) const; + results() const; // Set the number of results expected from this call. This is used // when the call appears in a context that expects multiple results, @@ -2292,9 +2292,6 @@ class Call_expression : public Expression Bexpression* set_results(Translate_context*); - Bexpression* - call_result_ref(Translate_context* context); - // The function to call. Expression* fn_; // The arguments to pass. This may be NULL if there are no @@ -2302,9 +2299,6 @@ class Call_expression : public Expression Expression_list* args_; // The type of the expression, to avoid recomputing it. Type* type_; - // The list of temporaries which will hold the results if the - // function returns a tuple. - std::vector* results_; // The backend expression for the call, used for a call which returns a tuple. Bexpression* call_; // A temporary variable to store this call if the function returns a tuple. -- cgit v1.2.1 From 687bf0c68d861017db06643b788e4bf95fe09d4f Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 28 Jul 2017 18:03:29 +0000 Subject: compiler: track placeholder pointer types for conversion We recently started walking through the hash table of pointer types to finalize them. Unfortunately it is possible to create a new pointer type while finalizing an existing one (test case: test/fixedbugs/issue5291) and that breaks the iteration. So, instead, keep a list of placeholder pointer types, and iterate through them while permitting the list to be extended as we go. Reviewed-on: https://go-review.googlesource.com/51771 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250683 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/types.cc | 15 +++++++++++---- gcc/go/gofrontend/types.h | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 1c649cb6ca9..9dc96cfc100 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -27804ec53590e3644e030c9860822139a0cfb03f +2118958321532352c91fd9406f571f8729a791cd The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 91d6091f544..4d923733667 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -1057,6 +1057,8 @@ Type::get_backend_placeholder(Gogo* gogo) { Location loc = Linemap::unknown_location(); bt = gogo->backend()->placeholder_pointer_type("", loc, false); + Pointer_type* pt = this->convert(); + Type::placeholder_pointers.push_back(pt); } break; @@ -5521,6 +5523,11 @@ Pointer_type::do_import(Import* imp) Type::Pointer_type_table Type::pointer_types; +// A list of placeholder pointer types. We keep this so we can ensure +// they are finalized. + +std::vector Type::placeholder_pointers; + // Make a pointer type. Pointer_type* @@ -5551,11 +5558,11 @@ Type::make_pointer_type(Type* to_type) void Type::finish_pointer_types(Gogo* gogo) { - for (Pointer_type_table::const_iterator i = pointer_types.begin(); - i != pointer_types.end(); - ++i) + // We don't use begin() and end() because it is possible to add new + // placeholder pointer types as we finalized existing ones. + for (size_t i = 0; i < Type::placeholder_pointers.size(); i++) { - Pointer_type* pt = i->second; + Pointer_type* pt = Type::placeholder_pointers[i]; Type_btypes::iterator tbti = Type::type_btypes.find(pt); if (tbti != Type::type_btypes.end() && tbti->second.is_placeholder) { diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h index f659f384845..f15f08ae4f0 100644 --- a/gcc/go/gofrontend/types.h +++ b/gcc/go/gofrontend/types.h @@ -1350,6 +1350,9 @@ class Type static Pointer_type_table pointer_types; + // List of placeholder pointer types. + static std::vector placeholder_pointers; + // The type classification. Type_classification classification_; // The backend representation of the type, once it has been -- cgit v1.2.1 From 4df0c2d44b02dcf423458aa75748183931a26e3f Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 28 Jul 2017 19:58:01 +0000 Subject: compiler: add backend type conversion Tweak Interface_field_reference_expression::do_get_backend to apply an additional backend type conversion to the returned result. This is needed due to the fact that the top level type of the expression is a function descriptor, however the value being manufactured is a pointer to struct. Reviewed-on: https://go-review.googlesource.com/51712 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250686 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/expressions.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 9dc96cfc100..685cff9935b 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -2118958321532352c91fd9406f571f8729a791cd +f7c36b27a49131f60eedde260896d310d735d408 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 79a2f524aa7..eb23ec26ecf 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -12057,12 +12057,15 @@ Interface_field_reference_expression::do_get_backend(Translate_context* context) Bexpression* bclosure = Expression::make_heap_expression(expr, loc)->get_backend(context); + Gogo* gogo = context->gogo(); + Btype* btype = this->type()->get_backend(gogo); + bclosure = gogo->backend()->convert_expression(btype, bclosure, loc); + Expression* nil_check = Expression::make_binary(OPERATOR_EQEQ, this->expr_, Expression::make_nil(loc), loc); Bexpression* bnil_check = nil_check->get_backend(context); - Gogo* gogo = context->gogo(); Bexpression* bcrash = gogo->runtime_error(RUNTIME_ERROR_NIL_DEREFERENCE, loc)->get_backend(context); -- cgit v1.2.1