From 0a0b836f87b882bea34ef0f66ada10765e581837 Mon Sep 17 00:00:00 2001 From: Andreas Zwinkau Date: Thu, 5 May 2011 10:15:19 +0200 Subject: [PATCH] fix opt/gcse_no_end jump threading must also copy Keep edges to keep End reachable. --- ir/opt/jumpthreading.c | 7 +++++++ 1 file changed, 7 insertions(+) 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)) -- 2.20.1