aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-12-08 15:51:25 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-12-08 15:51:25 +0000
commit55dccc1e0dbc8b975f5d14f151991f1c8412768e (patch)
tree916bbce811ecf95c3694babe08a797b550aaef06 /gcc
parent04bfa1e4691afb9eb0edcd9e80ec1e542628c7d4 (diff)
downloadgcc-55dccc1e0dbc8b975f5d14f151991f1c8412768e.zip
gcc-55dccc1e0dbc8b975f5d14f151991f1c8412768e.tar.gz
gcc-55dccc1e0dbc8b975f5d14f151991f1c8412768e.tar.bz2
compiler: make Slice_construction_expression::do_flatten idempotent
Because of the way we handle call expressions with multiple results, it's possible for expressions to be flattened more than once. In the case of Slice_construction_expression, allocating the slice storage multiple times caused a compiler crash as one of the Temporary_statement's wound up not getting a backend expression. Test case is https://golang.org/cl/34020. Reviewed-on: https://go-review.googlesource.com/34026 From-SVN: r243442
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/expressions.cc4
2 files changed, 3 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 7586fd4..dbba68f 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-08d221726e3f50cb197a931ba385fac67f66a028
+7a941ba323660ec7034cd92d4eab466024a3c72c
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/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 24f6b12..899fc9b 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -12951,8 +12951,8 @@ Slice_construction_expression::do_flatten(Gogo* gogo, Named_object* no,
// Base class flattening first
this->Array_construction_expression::do_flatten(gogo, no, inserter);
- // Create an stack-allocated storage temp if storage won't escape
- if (!this->storage_escapes_)
+ // Create a stack-allocated storage temp if storage won't escape
+ if (!this->storage_escapes_ && this->slice_storage_ == NULL)
{
Location loc = this->location();
this->array_val_ = create_array_val();