This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

reg-life-info is missing in newly created BBs in loop_optimizer_init


We were trying to activate the loop information in the SMS pass ,
so we called the loop_optimizer_init to collect the loop information at the
beginning of the SMS pass.
which caused an ICE, due to un-initialized reg_live_at_start/end fields in
the newly created basic blocks.
This problem caused due to the fact that cfg_layout_split_edge
 doesn't update the reg-life-info when creating new BB.

The patch bellow is one possible fix to the problem.
Another possibility is to call rtl_split_edge from cfg_layout_split_edge
(as done in cfg_layout_split_block).
Any comment?

*** cfgrtl.c.orig Tue Jul 13 17:20:24 2004
--- cfgrtl.c      Wed Jul 14 17:19:19 2004
***************
*** 2774,2781 ****
--- 2774,2803 ----
                  ? NEXT_INSN (BB_END (e->src)) : get_insns (),
                  NULL_RTX, e->src);

+   /* IBM local begin fixing the life information*/
+ #if 1
+    /* ??? This info is likely going to be out of date very soon.  */
+   if (e->dest->global_live_at_start)
+     {
+       new_bb->global_live_at_start = OBSTACK_ALLOC_REG_SET
(&flow_obstack);
+       new_bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&flow_obstack);
+       COPY_REG_SET (new_bb->global_live_at_start,
+                     e->dest->global_live_at_start);
+       COPY_REG_SET (new_bb->global_live_at_end,
+                     e->dest->global_live_at_start);
+     }
+
+    new_bb->rbi->footer = NULL;
+    e->src->rbi->footer = new_bb->rbi->header;
+
+ #endif
+   /* IBM local end fixing the life information */
+
    new_e = make_edge (new_bb, e->dest, EDGE_FALLTHRU);
    redirect_edge_and_branch_force (e, new_bb);
+
+
+
    return new_bb;
  }


Tnx
Yossi





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]