infinite loop in find_rgns
Sanjiv Kumar Gupta, Noida
sanjivg@noida.hcltech.com
Wed Apr 2 12:23:00 GMT 2003
>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
More information about the Gcc
mailing list