diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-07-24 17:22:03 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-07-24 17:22:03 +0000 |
commit | 525a825bc6fedc3a5d0c5311098ad55e830e8ac6 (patch) | |
tree | fb954857faf6db9e0a780900aafda6fb34473eeb /gcc | |
parent | 4e1952ab19938ee492bc15c0df77f959ab0cd9d3 (diff) | |
download | gcc-525a825bc6fedc3a5d0c5311098ad55e830e8ac6.zip gcc-525a825bc6fedc3a5d0c5311098ad55e830e8ac6.tar.gz gcc-525a825bc6fedc3a5d0c5311098ad55e830e8ac6.tar.bz2 |
compiler: Don't make temporaries for constant expressions.
Fixes golang/go#11039.
Reviewed-on: https://go-review.googlesource.com/10645
From-SVN: r226180
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/statements.cc | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a7b5246..2610a78 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -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. diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index a44145d..96c142c 100644 --- a/gcc/go/gofrontend/statements.cc +++ b/gcc/go/gofrontend/statements.cc @@ -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); |