From: Christoph Mallon Date: Sat, 21 Apr 2012 16:39:22 +0000 (+0200) Subject: Do not get the break block of a switch before it is sure that a jump there is actuall... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=b8f4fc13774d296a361e9e80e813a7eb906fc54b;p=cparser Do not get the break block of a switch before it is sure that a jump there is actually created. Usually the inner (compound) statement of a switch ends in a break or return, so there is no normal flow out of the switch statement. --- diff --git a/ast2firm.c b/ast2firm.c index ef5b89b..9a96478 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -4996,7 +4996,9 @@ static ir_node *switch_statement_to_firm(switch_statement_t *statement) statement_to_firm(statement->body); - jump_if_reachable(get_break_label()); + if (currently_reachable()) { + add_immBlock_pred(get_break_label(), new_Jmp()); + } if (!saw_default_label && switch_node) { ir_node *proj = new_d_Proj(dbgi, switch_node, mode_X, pn_Switch_default);