This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]