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]

RE: infinite loop in find_rgns


>In my case , current_edge is 0 at start. This is running in 
>infinite loop then.

I got the above problem while trying to enable the first
scheduling pass for SH4.

The problem is, find_rgns() doesn't work in case of CFG not
having a basic block whose index is 0. In case of SH4,
the CFG starts with BB1 instead of BB0 for find_rgns 
(optimize_mode_switching converts the CFG in this way). So the 
follwing assignment is probably not correct in this case.

Line 628 sched-rgn.c
	...,current_edge = out_edges[0];

Since the array out_edges is xcalloced, it gives current_edge as
0 even if the BB0 is not present in the CFG. And since the current_edge
is 0 at start, it runs into infinite loop.

One solution to correct this is to check the value
of current_edge till you get a valid value (0 is an illegal
 value I guess). 
Looking for your suggestions while I am experimenting this.

--Sanjiv


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