re PR go/80226 (ICE gimple-expr.c:474 on Go function returning multiple empty struct...
authorThan McIntosh <thanm@google.com>
Tue, 28 Mar 2017 20:08:31 +0000 (20:08 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 28 Mar 2017 20:08:31 +0000 (20:08 +0000)
PR go/80226
* go-gcc.cc (Gcc_backend::return_statement): Check for
void_type_node when checking result size.

From-SVN: r246553

gcc/go/ChangeLog
gcc/go/go-gcc.cc

index 8958f762fcfa7bc742865349d28d67f8f8f309ad..55d78efd9472e96d8243cb85751d16c919a91bdd 100644 (file)
@@ -1,3 +1,9 @@
+2017-03-28  Than McIntosh  <thanm@google.com>
+
+       PR go/80226
+       * go-gcc.cc (Gcc_backend::return_statement): Check for
+       void_type_node when checking result size.
+
 2017-02-20  Ian Lance Taylor  <iant@golang.org>
 
        PR go/79642
index ed6fc2c61059b290e0a5477cc63b907bd68d6670..62baa91fab886caa08c132be9e7e172103d9b579 100644 (file)
@@ -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();