From: Andreas Zwinkau Date: Thu, 5 May 2011 08:15:19 +0000 (+0200) Subject: fix opt/gcse_no_end X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=0a0b836f87b882bea34ef0f66ada10765e581837;p=libfirm fix opt/gcse_no_end jump threading must also copy Keep edges to keep End reachable. --- diff --git a/ir/opt/jumpthreading.c b/ir/opt/jumpthreading.c index 0f519a964..39e07dbe9 100644 --- a/ir/opt/jumpthreading.c +++ b/ir/opt/jumpthreading.c @@ -275,6 +275,13 @@ static void copy_and_fix(const jumpthreading_env_t *env, ir_node *block, ir_node *copy; ir_mode *mode; + if (is_End(node)) { + /* edge is a Keep edge. If the end block is unreachable via normal control flow, + * we must maintain end's reachability with Keeps. + */ + keep_alive(copy_block); + continue; + } /* ignore control flow */ mode = get_irn_mode(node); if (mode == mode_X || is_Cond(node))