aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-gcc.cc
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2017-03-28 20:08:31 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-03-28 20:08:31 +0000
commit1f599d751ecacf9bcec4fe5ebaaaa1891d1b820e (patch)
treedac722570cfe68a1d0e7d43f5a30c1f1158f71e5 /gcc/go/go-gcc.cc
parent0c6b03b5158f53a3c7042cf8625aa5e6bc74f52b (diff)
downloadgcc-1f599d751ecacf9bcec4fe5ebaaaa1891d1b820e.zip
gcc-1f599d751ecacf9bcec4fe5ebaaaa1891d1b820e.tar.gz
gcc-1f599d751ecacf9bcec4fe5ebaaaa1891d1b820e.tar.bz2
re PR go/80226 (ICE gimple-expr.c:474 on Go function returning multiple empty struct/array values)
PR go/80226 * go-gcc.cc (Gcc_backend::return_statement): Check for void_type_node when checking result size. From-SVN: r246553
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r--gcc/go/go-gcc.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index ed6fc2c..62baa91 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();