+2009-08-04 Aleksey Demakov <ademakov@gmail.com>
+
+ * jit/jit-block.c (_jit_block_clean_cfg): avoid jump tables
+ while cleaning branches (thanks Fredrik Ehnbom).
+
2009-06-10 Aleksey Demakov <ademakov@gmail.com>
* jit/jit-rules-x86.ins (JIT_OP_BR_LFALSE): add opcode rule.
}
if(block->succs[0]->flags == _JIT_EDGE_BRANCH)
{
+ insn = _jit_block_get_last(block);
+ if(insn->opcode == JIT_OP_JUMP_TABLE)
+ {
+ /* skip jump tables, handle only branches */
+ continue;
+ }
if(block->succs[0]->dst == block->next)
{
/* Replace useless branch with NOP */
changed = 1;
- insn = _jit_block_get_last(block);
insn->opcode = JIT_OP_NOP;
if(block->num_succs == 1)
{
remove the fallthough edge while leaving the branch
edge */
changed = 1;
- insn = _jit_block_get_last(block);
insn->opcode = JIT_OP_BR;
block->ends_in_dead = 1;
delete_edge(func, block->succs[1]);