Commit 525a825b by Ian Lance Taylor

compiler: Don't make temporaries for constant expressions.

    
    Fixes golang/go#11039.
    
    Reviewed-on: https://go-review.googlesource.com/10645

From-SVN: r226180
parent 4e1952ab
cbb27e8089e11094a20502e53ef69c9c36955f85 ac462880e803a926005f1756b0f8d82ff0c47499
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -689,7 +689,8 @@ Move_subexpressions::expression(Expression** pexpr) ...@@ -689,7 +689,8 @@ Move_subexpressions::expression(Expression** pexpr)
if (this->skip_ > 0) if (this->skip_ > 0)
--this->skip_; --this->skip_;
else if ((*pexpr)->temporary_reference_expression() == NULL else if ((*pexpr)->temporary_reference_expression() == NULL
&& !(*pexpr)->is_nil_expression()) && !(*pexpr)->is_nil_expression()
&& !(*pexpr)->is_constant())
{ {
Location loc = (*pexpr)->location(); Location loc = (*pexpr)->location();
Temporary_statement* temp = Statement::make_temporary(NULL, *pexpr, loc); Temporary_statement* temp = Statement::make_temporary(NULL, *pexpr, loc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment