Do not unconditionally remove labels from blocks.

Labels can be shared between multiple flow-control instructions, so use the
label's used counter to determine when to remove the label. This was
causing problems with the jump threading.
This commit is contained in:
Bill Currie 2012-05-03 19:22:57 +09:00
parent c79620f04c
commit ab73a267cd

View file

@ -1108,7 +1108,8 @@ remove_dead_blocks (sblock_t *blocks)
label = s->opa->o.label; label = s->opa->o.label;
else if (!strncmp (s->opcode, "<IF", 3)) else if (!strncmp (s->opcode, "<IF", 3))
label = s->opb->o.label; label = s->opb->o.label;
remove_label_from_dest (label); if (label && !--label->used)
remove_label_from_dest (label);
did_something = 1; did_something = 1;
sblock->next = sb->next; sblock->next = sb->next;