[Bug go/80226] ICE gimple-expr.c:474 on Go function returning multiple empty struct/array values
thanm at google dot com
gcc-bugzilla@gcc.gnu.org
Mon Mar 27 20:07:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80226
--- Comment #1 from Than McIntosh <thanm at google dot com> ---
This seems to do the trick:
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index ed6fc2c6105..62baa91fab8 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -2081,7 +2081,8 @@ Gcc_backend::return_statement(Bfunction* bfunction,
// If the result size is zero bytes, we have set the function type
// to have a result type of void, so don't return anything.
// See the function_type method.
- if (int_size_in_bytes(TREE_TYPE(result)) == 0)
+ tree res_type = TREE_TYPE(result);
+ if (res_type == void_type_node || int_size_in_bytes(res_type) == 0)
{
tree stmt_list = NULL_TREE;
for (std::vector<Bexpression*>::const_iterator p = vals.begin();
More information about the Gcc-bugs
mailing list