compiler: Don't make temporaries for constant expressions.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 24 Jul 2015 17:22:03 +0000 (17:22 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 24 Jul 2015 17:22:03 +0000 (17:22 +0000)
    Fixes golang/go#11039.

    Reviewed-on: https://go-review.googlesource.com/10645

From-SVN: r226180

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/statements.cc

index a7b5246ad3962bb38360a8e788ff03f7fa6dae84..2610a78ced0aa42081f1cafb804b4add970f6990 100644 (file)
@@ -1,4 +1,4 @@
-cbb27e8089e11094a20502e53ef69c9c36955f85
+ac462880e803a926005f1756b0f8d82ff0c47499
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index a44145da23e644845ad679a09dcfde17cf4d834a..96c142c6eab91344ec1def04bfa4dd670a89e647 100644 (file)
@@ -689,7 +689,8 @@ Move_subexpressions::expression(Expression** pexpr)
   if (this->skip_ > 0)
     --this->skip_;
   else if ((*pexpr)->temporary_reference_expression() == NULL
-          && !(*pexpr)->is_nil_expression())
+          && !(*pexpr)->is_nil_expression()
+           && !(*pexpr)->is_constant())
     {
       Location loc = (*pexpr)->location();
       Temporary_statement* temp = Statement::make_temporary(NULL, *pexpr, loc);