This patch by Than McIntosh removes an unnecessary initializer when building the set of values to store in a slice of zero length. This removes some code that dates back to 2008 and may have something to do with different handling of nil slices back then (I no longer recall). Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 243619) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -556a546ba3c7bb14bd1b9b8469ee3b7a914909f6 +5eb55901861f360c2c2ff70f14a8315694934c97 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/expressions.cc =================================================================== --- gcc/go/gofrontend/expressions.cc (revision 243442) +++ gcc/go/gofrontend/expressions.cc (working copy) @@ -12926,12 +12926,6 @@ Slice_construction_expression::create_ar go_assert(this->valtype_ != NULL); Expression_list* vals = this->vals(); - if (this->vals() == NULL || this->vals()->empty()) - { - // We need to create a unique value for the empty array literal. - vals = new Expression_list; - vals->push_back(NULL); - } return new Fixed_array_construction_expression( this->valtype_, this->indexes(), vals, loc); }