From ea9b01d4ff31637cc034c182102198b3cfcb0ea9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 16 Dec 2014 21:36:53 +0000 Subject: [PATCH] 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 --- gcc/go/gofrontend/statements.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index 6094e5c684b..6eb0d7bcc78 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()); -- 2.30.2