public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Go patch committed: Always lower subexpressions of lowered expressions
@ 2012-01-25 18:54 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2012-01-25 18:54 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 380 bytes --]

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-25 18:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-25 18:54 Go patch committed: Always lower subexpressions of lowered expressions 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).