This is the mail archive of the
mailing list for the GCC project.
Go patch committed: Fix inconsistent check for == as memcmp
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Thu, 19 Sep 2013 10:33:34 -0700
- Subject: Go patch committed: Fix inconsistent check for == as memcmp
- Authentication-results: sourceware.org; auth=none
The Go frontend was inconsistent in determining whether a struct could
use memcmp for the == operator. This could cause one package to decide
that it could use == and a package importing that one to determine that
it could not. The effect was an undefined symbol at link time. This
patch fixes the problem. I've added a test case (bug479) to the master
testsuite, which will be brought over to the gccgo testsuite in due
course. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline and 4.8 branch.
diff -r 2b23d9831cf7 go/expressions.cc
--- a/go/expressions.cc Wed Sep 18 16:26:07 2013 -0700
+++ b/go/expressions.cc Thu Sep 19 10:28:24 2013 -0700
@@ -7752,8 +7752,6 @@
- if (arg_type->named_type() != NULL)
unsigned int ret;
if (this->code_ == BUILTIN_SIZEOF)
diff -r 2b23d9831cf7 go/types.cc
--- a/go/types.cc Wed Sep 18 16:26:07 2013 -0700
+++ b/go/types.cc Thu Sep 19 10:28:24 2013 -0700
@@ -2288,9 +2288,7 @@
- // Begin converting this type to the backend representation.
- // This will create a placeholder if necessary.