From 75aa28cfacc349f2113ee686ff9bf5970a84a0c2 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 4 May 2012 10:58:18 +0900 Subject: [PATCH] Mark all subsequent blocks as reachable after if/goto merge. If an if/goto merge is done in the first dead block pass, no blocks after the merge have their rechable flag set because they've never been tested. --- 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 61c280831..c41ec8930 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -1146,8 +1146,9 @@ remove_dead_blocks (sblock_t *blocks) remove_label_from_dest (s->opb->o.label); s->opb->o.label = sb->statements->opa->o.label; invert_conditional (s); - sb->next->reachable = 1; sb->reachable = 0; + for (sb = sb->next; sb; sb = sb->next) + sb->reachable = 1; break; } else if (!is_goto (s) && !is_return (s)) { sb->reachable = 1;