Remove gotos that go to the following statement.

eg:
	goto foo:
foo:
	//some code
This commit is contained in:
Bill Currie 2012-11-24 15:08:48 +09:00
parent 738fc65e0f
commit f4604d9db5

View file

@ -1224,6 +1224,15 @@ thread_jumps (sblock_t *blocks)
l->used++;
*label = l;
}
if (is_goto (s) && (*label)->dest == sblock->next) {
statement_t **p;
unuse_label (*label);
for (p = &sblock->statements; *p != s; p = &(*p)->next)
;
free_statement (s);
*p = 0;
sblock->tail = p;
}
}
}