From: Ian Lance Taylor Date: Tue, 16 Dec 2014 21:36:53 +0000 (+0000) Subject: re PR go/61246 (gccgo: ICE in do_determine_types [GoSmith]) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea9b01d4ff31637cc034c182102198b3cfcb0ea9;p=gcc.git 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 --- 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());