@@ -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());
@@ -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"