From 912bd566ad7b019aaca37ee4193f949afc34eaae Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 16 Feb 2018 16:42:53 +0000 Subject: runtime: add some more preemption checks In particular this lets BenchmarkPingPongHog in runtime/proc_test.go complete. Reviewed-on: https://go-review.googlesource.com/94735 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257743 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 baf77e31e70..cb7dffd7905 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -5d5ea2fd05dbf369ccc53c93d4846623cdea0c47 +cef3934fbc63f5e121abb8f88d3799961ac95b59 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 f895ea1f24fb2ebdc496a13f25911321a1b4a09f Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 20 Feb 2018 13:52:56 +0000 Subject: compiler: look through aliases for type compatibility 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257845 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/types.cc | 29 ++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index cb7dffd7905..61bed68afca 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -cef3934fbc63f5e121abb8f88d3799961ac95b59 +459a8a94e04a19bde7173ef7cf2db369c2e62e2d 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 40eccfcadca..11924e6e224 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -597,10 +597,10 @@ Type::are_compatible_for_comparison(bool is_equality_op, const Type *t1, return false; } - if (t1->named_type() != NULL) - return t1->named_type()->named_type_is_comparable(reason); - else if (t2->named_type() != NULL) - return t2->named_type()->named_type_is_comparable(reason); + if (t1->unalias()->named_type() != NULL) + return t1->unalias()->named_type()->named_type_is_comparable(reason); + else if (t2->unalias()->named_type() != NULL) + return t2->unalias()->named_type()->named_type_is_comparable(reason); else if (t1->struct_type() != NULL) { if (t1->struct_type()->is_struct_incomparable()) @@ -678,6 +678,12 @@ Type::are_assignable(const Type* lhs, const Type* rhs, std::string* reason) if (Type::are_identical(lhs, rhs, true, reason)) return true; + // Ignore aliases, except for error messages. + const Type* lhs_orig = lhs; + const Type* rhs_orig = rhs; + lhs = lhs->unalias(); + rhs = rhs->unalias(); + // The types are assignable if they have identical underlying types // and either LHS or RHS is not a named type. if (((lhs->named_type() != NULL && rhs->named_type() == NULL) @@ -740,15 +746,16 @@ Type::are_assignable(const Type* lhs, const Type* rhs, std::string* reason) { if (rhs->interface_type() != NULL) reason->assign(_("need explicit conversion")); - else if (lhs->named_type() != NULL && rhs->named_type() != NULL) + else if (lhs_orig->named_type() != NULL + && rhs_orig->named_type() != NULL) { - size_t len = (lhs->named_type()->name().length() - + rhs->named_type()->name().length() + size_t len = (lhs_orig->named_type()->name().length() + + rhs_orig->named_type()->name().length() + 100); char* buf = new char[len]; snprintf(buf, len, _("cannot use type %s as type %s"), - rhs->named_type()->message_name().c_str(), - lhs->named_type()->message_name().c_str()); + rhs_orig->named_type()->message_name().c_str(), + lhs_orig->named_type()->message_name().c_str()); reason->assign(buf); delete[] buf; } @@ -768,6 +775,10 @@ Type::are_convertible(const Type* lhs, const Type* rhs, std::string* reason) if (Type::are_assignable(lhs, rhs, reason)) return true; + // Ignore aliases. + lhs = lhs->unalias(); + rhs = rhs->unalias(); + // A pointer to a regular type may not be converted to a pointer to // a type that may not live in the heap, except when converting from // unsafe.Pointer. -- cgit v1.2.1 From 5c86851d15e32cd60677d57bb88ac4a55cd1e03e Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 20 Feb 2018 15:30:31 +0000 Subject: runtime: allow preemption in fast syscall return 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257848 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 61bed68afca..c52bf4e0dc0 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -459a8a94e04a19bde7173ef7cf2db369c2e62e2d +c6e0970f75508e209a10a7db5164d6ea3f9b28bf 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 ac58a228df4ae9b2d7752e89f6323600e1ecac53 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 22 Feb 2018 18:49:33 +0000 Subject: libgo: add -L option for libatomic when using -pthread Fixes https://gcc.gnu.org/PR84484 Reviewed-on: https://go-review.googlesource.com/95436 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257911 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 c52bf4e0dc0..f5d71f57d33 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -c6e0970f75508e209a10a7db5164d6ea3f9b28bf +b4d61f028dd1623142df4130b6c660bb77474b7b 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 48cd836f73a91f430cc8088d7be8159a08162f8c Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 22 Feb 2018 18:52:33 +0000 Subject: runtime: funcfileline: get missing function name from symbol table 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257913 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 f5d71f57d33..b708cb7c603 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -b4d61f028dd1623142df4130b6c660bb77474b7b +ed8647cc99652db2d689215c05f31ad038438a7e 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 e65055a558093bd4fc0b1b0024b7814cc187b8e8 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 23 Feb 2018 21:38:57 +0000 Subject: compiler: ignore aliases in fieldtrack info 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257954 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/expressions.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index b708cb7c603..88291d585f9 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -ed8647cc99652db2d689215c05f31ad038438a7e +8b3d6091801d485c74a9c92740c69673e39160b0 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 9792faaa0e4..10ab5b50db9 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -11696,7 +11696,7 @@ Field_reference_expression::do_lower(Gogo* gogo, Named_object* function, Location loc = this->location(); std::string s = "fieldtrack \""; - Named_type* nt = this->expr_->type()->named_type(); + Named_type* nt = this->expr_->type()->unalias()->named_type(); if (nt == NULL || nt->named_object()->package() == NULL) s.append(gogo->pkgpath()); else -- cgit v1.2.1