- do not move the return out of labeled blocks, this must be still reachable
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Tue, 9 Dec 2008 12:26:37 +0000 (12:26 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Tue, 9 Dec 2008 12:26:37 +0000 (12:26 +0000)
[r24450]

ir/opt/return.c

index c91b88f..ebfb2f3 100644 (file)
@@ -198,7 +198,8 @@ static int can_move_ret(ir_node *ret) {
 
        /* check, that predecessors are Jmps */
        n = get_Block_n_cfgpreds(retbl);
-       if (n <= 1)
+       /* we cannot move above a labeled block, as this might kill the block */
+       if (n <= 1 || has_Block_label(retbl))
                return 0;
        for (i = 0; i < n; ++i) {
                ir_node *pred = get_Block_cfgpred(retbl, i);