From a09f92e3d7a2bb58a4602b94371ea6d6514eff1b Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 27 Feb 2009 17:06:41 +0000 Subject: [PATCH] don't emit dead initializers [r25577] --- ast2firm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ast2firm.c b/ast2firm.c index 94f83e3..b74308b 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -4753,6 +4753,11 @@ static void initialize_local_declaration(entity_t *entity) if (entity->base.symbol == NULL) return; + // no need to emit code in dead blocks + if (entity->declaration.storage_class != STORAGE_CLASS_STATIC + && get_cur_block() == NULL) + return; + switch ((declaration_kind_t) entity->declaration.kind) { case DECLARATION_KIND_LOCAL_VARIABLE: case DECLARATION_KIND_LOCAL_VARIABLE_ENTITY: -- 2.20.1