This patch by Cherry Zhang fixes the Go frontend to use the int type
for the len & cap arguments to a  slice value.  Bootstrapped and ran
Go testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 267661)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-085ef4556ec810a5a9c422e7b86d98441dc92e86
+960637781ca9546ea2db913e48afd7eccbdadfa9
 
 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 267660)
+++ gcc/go/gofrontend/expressions.cc    (working copy)
@@ -7821,8 +7821,10 @@ Builtin_call_expression::lower_make(Stat
                                           cap_arg);
       mem = Expression::make_unsafe_cast(Type::make_pointer_type(et), mem,
                                         loc);
-      call = Expression::make_slice_value(type, mem, len_arg->copy(),
-                                         cap_arg->copy(), loc);
+      Type* int_type = Type::lookup_integer_type("int");
+      len_arg = Expression::make_cast(int_type, len_arg->copy(), loc);
+      cap_arg = Expression::make_cast(int_type, cap_arg->copy(), loc);
+      call = Expression::make_slice_value(type, mem, len_arg, cap_arg, loc);
     }
   else if (is_map)
     {

Reply via email to