This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Always lower subexpressions of lowered expressions
- 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: Wed, 25 Jan 2012 10:54:37 -0800
- Subject: Go patch committed: Always lower subexpressions of lowered expressions
This patch to the Go frontend always lowers subexpressions of lowered
expressions. This ensures that all parts of an expression are lowered.
Without this change, comparisons of struct fields embedded within
structs were not handled correctly. They would be passed to the backend
as an EQ_EXPR of the struct, which failed if some of the fields required
a more complex comparison (e.g., strings). Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r be2e13389165 go/gogo.cc
--- a/go/gogo.cc Tue Jan 24 15:24:58 2012 -0800
+++ b/go/gogo.cc Wed Jan 25 10:52:19 2012 -0800
@@ -1520,6 +1520,8 @@
&this->inserter_, this->iota_value_);
if (enew == e)
break;
+ if (enew->traverse_subexpressions(this) == TRAVERSE_EXIT)
+ return TRAVERSE_EXIT;
*pexpr = enew;
}
return TRAVERSE_SKIP_COMPONENTS;