- if (need_label && (emit_env->cg->opt & IA32_OPT_EXTBB)) {
- /* if the extended block scheduler is used, only leader blocks need
- labels. */
- need_label = (block == get_extbb_leader(get_nodes_extbb(block)));
+ if (is_Proj(pred)) {
+ assert(get_irn_mode(pred) == mode_X);
+ if (is_ia32_SwitchJmp(get_Proj_pred(pred))) {
+ need_label = 1;
+ break;
+ }
+ }
+ }
+
+ /* special case because the start block contains no jump instruction */
+ if (last_block == start_block) {
+ const ir_edge_t *edge;
+ ir_node *startsucc = NULL;
+
+ foreach_block_succ(start_block, edge) {
+ startsucc = get_edge_src_irn(edge);
+ if (startsucc != start_block)
+ break;
+ }
+ assert(startsucc != NULL);
+
+ /* if the last block was the start block and we are not inside the */
+ /* start successor, emit a jump to the start successor */
+ if (startsucc != block) {
+ char buf[SNPRINTF_BUF_LEN];
+ ir_snprintf(buf, sizeof(buf), BLOCK_PREFIX("%d"),
+ get_irn_node_nr(startsucc));
+ ir_fprintf(F, "\tjmp %s\n", buf);
+ }