ia32: make sure the stackframe IncSp is always used
authorMatthias Braun <matze@braunis.de>
Tue, 23 Aug 2011 11:22:40 +0000 (13:22 +0200)
committerMatthias Braun <matze@braunis.de>
Tue, 23 Aug 2011 11:31:08 +0000 (13:31 +0200)
ir/be/ia32/bearch_ia32.c

index ae5cf8e..030b6af 100644 (file)
@@ -1292,6 +1292,13 @@ static void introduce_prolog_epilog(ir_graph *irg)
                set_irn_n(push, n_ia32_Push_stack, initial_sp);
                sched_add_after(curr_sp, incsp);
 
+               /* make sure the initial IncSP is really used by someone */
+               if (get_irn_n_edges(incsp) <= 1) {
+                       ir_node *in[] = { incsp };
+                       ir_node *keep = be_new_Keep(block, 1, in);
+                       sched_add_after(incsp, keep);
+               }
+
                layout->initial_bias = -4;
        } else {
                ir_node *incsp = be_new_IncSP(sp, block, curr_sp, frame_size, 0);