From ab73a267cdc26f640be7cda312c6b484822b2b2d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 3 May 2012 19:22:57 +0900 Subject: [PATCH] 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. --- tools/qfcc/source/statements.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index 2a111b20c..323925605 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -1108,7 +1108,8 @@ remove_dead_blocks (sblock_t *blocks) label = s->opa->o.label; else if (!strncmp (s->opcode, "opb->o.label; - remove_label_from_dest (label); + if (label && !--label->used) + remove_label_from_dest (label); did_something = 1; sblock->next = sb->next;