* go-gcc.cc (Gcc_backend::compound_statement): Don't return
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Aug 2014 17:40:51 +0000 (17:40 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Aug 2014 17:40:51 +0000 (17:40 +0000)
NULL_TREE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213761 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 069618d..f7c44c5 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-08  Ian Lance Taylor  <iant@google.com>
+
+       * go-gcc.cc (Gcc_backend::compound_statement): Don't return
+       NULL_TREE.
+
 2014-07-24  Uros Bizjak  <ubizjak@gmail.com>
 
        * go-gcc.cc (Gcc_backend::global_variable_set_init): Rename
index 97904d0..a34fad8 100644 (file)
@@ -2123,6 +2123,12 @@ Gcc_backend::compound_statement(Bstatement* s1, Bstatement* s2)
   if (t == error_mark_node)
     return this->error_statement();
   append_to_statement_list(t, &stmt_list);
+
+  // If neither statement has any side effects, stmt_list can be NULL
+  // at this point.
+  if (stmt_list == NULL_TREE)
+    stmt_list = integer_zero_node;
+
   return this->make_statement(stmt_list);
 }