aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2014-12-16 21:36:53 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-12-16 21:36:53 +0000
commitea9b01d4ff31637cc034c182102198b3cfcb0ea9 (patch)
treea9235fdd3621d1a86d359831a4190adaeeedb9b4
parente49aee92bb85865aa0512ed5e827c1a93fdcd928 (diff)
downloadgcc-ea9b01d4ff31637cc034c182102198b3cfcb0ea9.zip
gcc-ea9b01d4ff31637cc034c182102198b3cfcb0ea9.tar.gz
gcc-ea9b01d4ff31637cc034c182102198b3cfcb0ea9.tar.bz2
re PR go/61246 (gccgo: ICE in do_determine_types [GoSmith])
PR go/61246 compiler: Switch expression comparisons should be boolean typed. From-SVN: r218794
-rw-r--r--gcc/go/gofrontend/statements.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc
index 6094e5c..6eb0d7b 100644
--- a/gcc/go/gofrontend/statements.cc
+++ b/gcc/go/gofrontend/statements.cc
@@ -3857,7 +3857,11 @@ Switch_statement::do_lower(Gogo*, Named_object*, Block* enclosing,
Expression* val = this->val_;
if (val == NULL)
val = Expression::make_boolean(true, loc);
- Temporary_statement* val_temp = Statement::make_temporary(NULL, val, loc);
+
+ Type* type = val->type();
+ if (type->is_abstract())
+ type = type->make_non_abstract_type();
+ Temporary_statement* val_temp = Statement::make_temporary(type, val, loc);
b->add_statement(val_temp);
this->clauses_->lower(b, val_temp, this->break_label());