* Go patch committed: Remove unnecessary tests
@ 2015-07-20 17:25 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2015-07-20 17:25 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 248 bytes --]
This patch by Chris Manghane removes some unnecessary tests from the
Go frontend. These checks are now handled by the GCC-specific code in
gcc/go/go-gcc.cc. Bootstrapped and ran testsuite on
x86_64-unknown-linux-gnu. Committed to mainline.
Ian
[-- Attachment #2: foo.txt --]
[-- Type: text/plain, Size: 1702 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 225757)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-2c985e4781691fea3eb4171de85265bfbc4e4997
+19ff97ed3eb07d902bc4b3f97b21c4b6df834ad2
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Index: gcc/go/gofrontend/expressions.cc
===================================================================
--- gcc/go/gofrontend/expressions.cc (revision 225751)
+++ gcc/go/gofrontend/expressions.cc (working copy)
@@ -133,7 +133,7 @@ Expression::determine_type_no_context()
// assignment.
Expression*
-Expression::convert_for_assignment(Gogo* gogo, Type* lhs_type,
+Expression::convert_for_assignment(Gogo*, Type* lhs_type,
Expression* rhs, Location location)
{
Type* rhs_type = rhs->type();
@@ -177,17 +177,6 @@ Expression::convert_for_assignment(Gogo*
|| (lhs_type->array_type() != NULL
&& rhs_type->array_type() != NULL))
{
- // Avoid confusion from zero sized variables which may be
- // represented as non-zero-sized.
- // TODO(cmang): This check is for a GCC-specific issue, and should be
- // removed from the frontend. FIXME.
- int64_t lhs_size =
- gogo->backend()->type_size(lhs_type->get_backend(gogo));
- int64_t rhs_size =
- gogo->backend()->type_size(rhs_type->get_backend(gogo));
- if (rhs_size == 0 || lhs_size == 0)
- return rhs;
-
// This conversion must be permitted by Go, or we wouldn't have
// gotten here.
return Expression::make_unsafe_cast(lhs_type, rhs, location);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-20 16:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-20 17:25 Go patch committed: Remove unnecessary tests Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).