From: Ian Lance Taylor Date: Sat, 13 Dec 2014 01:41:49 +0000 (+0000) Subject: re PR go/61254 (gccgo: spurious "error: slice end must be integer" [GoSmith]) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=967b254be1e60b4cb21c8e55a7f4b0346149b3ec;p=gcc.git re PR go/61254 (gccgo: spurious "error: slice end must be integer" [GoSmith]) PR go/61254 compiler: Don't move nil subexpressions into temporaries. From-SVN: r218701 --- diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index 5b8c2e73fc7..6094e5c684b 100644 --- a/gcc/go/gofrontend/statements.cc +++ b/gcc/go/gofrontend/statements.cc @@ -677,7 +677,8 @@ Move_subexpressions::expression(Expression** pexpr) { if (this->skip_ > 0) --this->skip_; - else if ((*pexpr)->temporary_reference_expression() == NULL) + else if ((*pexpr)->temporary_reference_expression() == NULL + && !(*pexpr)->is_nil_expression()) { Location loc = (*pexpr)->location(); Temporary_statement* temp = Statement::make_temporary(NULL, *pexpr, loc);