diff mbox

Go patch committed: Update for mainline changes

Message ID mcrr4ach206.fsf@iant-glaptop.roam.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Nov. 19, 2013, 2:58 p.m. UTC
This patch to the Go frontend incorporates patches by Richard S and
Diego for changes to the middle-end.  These patches were already
committed to the GCC repository.  This change commits them to the master
Go repository.

Ian
diff mbox

Patch

diff -r 75537ee240ab go/expressions.cc
--- a/go/expressions.cc	Mon Nov 18 18:29:34 2013 -0800
+++ b/go/expressions.cc	Tue Nov 19 06:55:30 2013 -0800
@@ -11,6 +11,8 @@ 
 #include "toplev.h"
 #include "intl.h"
 #include "tree.h"
+#include "stringpool.h"
+#include "stor-layout.h"
 #include "gimple.h"
 #include "gimplify.h"
 #include "tree-iterator.h"
@@ -3343,9 +3345,9 @@ 
       tree int_type_tree = type_to_tree(int_type->get_backend(gogo));
 
       expr_tree = fold_convert(int_type_tree, expr_tree);
-      if (host_integerp(expr_tree, 0))
-	{
-	  HOST_WIDE_INT intval = tree_low_cst(expr_tree, 0);
+      if (tree_fits_shwi_p (expr_tree))
+	{
+	  HOST_WIDE_INT intval = tree_to_shwi (expr_tree);
 	  std::string s;
 	  Lex::append_char(intval, true, &s, this->location());
 	  Expression* se = Expression::make_string(s, this->location());
diff -r 75537ee240ab go/gogo-tree.cc
--- a/go/gogo-tree.cc	Mon Nov 18 18:29:34 2013 -0800
+++ b/go/gogo-tree.cc	Tue Nov 19 06:55:30 2013 -0800
@@ -8,6 +8,9 @@ 
 
 #include "toplev.h"
 #include "tree.h"
+#include "stringpool.h"
+#include "stor-layout.h"
+#include "varasm.h"
 #include "gimple.h"
 #include "gimplify.h"
 #include "tree-iterator.h"