The Go frontend crashed doing an array assignment of two values of type
[2][]int.  This patch fixes it.  Normal array assignments worked because
gcc uses the same structure for all arrays with the same length and
element type.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r 3a8aa04c3a9a go/expressions.cc
--- a/go/expressions.cc	Wed Mar 07 13:51:48 2012 -0800
+++ b/go/expressions.cc	Wed Mar 07 17:36:41 2012 -0800
@@ -284,8 +284,10 @@
 	   || SCALAR_FLOAT_TYPE_P(lhs_type_tree)
 	   || COMPLEX_FLOAT_TYPE_P(lhs_type_tree))
     return fold_convert_loc(location.gcc_location(), lhs_type_tree, rhs_tree);
-  else if (TREE_CODE(lhs_type_tree) == RECORD_TYPE
-	   && TREE_CODE(TREE_TYPE(rhs_tree)) == RECORD_TYPE)
+  else if ((TREE_CODE(lhs_type_tree) == RECORD_TYPE
+	    && TREE_CODE(TREE_TYPE(rhs_tree)) == RECORD_TYPE)
+	   || (TREE_CODE(lhs_type_tree) == ARRAY_TYPE
+	       && TREE_CODE(TREE_TYPE(rhs_tree)) == ARRAY_TYPE))
     {
       // This conversion must be permitted by Go, or we wouldn't have
       // gotten here.

Reply via email to