Actually the error is following: hello.c:17:1: internal compiler error: in calc_dfs_tree, at dominance.c:394 Thanks Abdul On Thu, May 19, 2011 at 7:08 PM, Abdul Wahid Memon <engrwahidmemon@xxxxxxxxx> wrote: > Thanks alot Ian. Actually it is working but when there is only once > function in the source file. What to do when there are more than one > functions. > Thanks > > Abdul > > On Thu, May 19, 2011 at 6:59 PM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote: >> Abdul Wahid Memon <engrwahidmemon@xxxxxxxxx> writes: >> >>> Thanks alot. Its working well at GIMPLE but for RTL, it is again >>> posing a problem of internal compiler error. >> >> loop_optimizer_init does work for RTL passes, so you are going to have >> to debug what is going wrong. >> >> Ian >> >>> On Thu, May 19, 2011 at 2:28 AM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote: >>>> Abdul Wahid Memon <engrwahidmemon@xxxxxxxxx> writes: >>>> >>>>> I am facing some problem at obtaining the number of loops in the source program. >>>>> I am trying to use a function number_of_loops defined in cfgloop.h >>>>> with the help of plugin. >>>>> >>>>> I have tried to capture this at both GIMPLE level after copy headers >>>>> pass where I always get the value of 0, >>>>> because the condition if (!current_loops) return 0; is (I think) >>>>> always becoming true and the same thing happens >>>>> at RTL after 'loop2_init' pass but I get the value of 1 even in the >>>>> presence or in the absence of any loop. >>>>> >>>>> This is the first time I am playing with GCC plugins. Please help me >>>>> out with this issue. >>>>> >>>>> PS: The passes after which I am puting my passes are definitely >>>>> producing the information about the loops as >>>>> can be seen from the dumps produced by copy headers pass and loop >>>>> initialization. >>>> >>>> If you want to call number_of_loops you need to call loop_optimizer_init >>>> at the start of your pass and loop_optimizer_finalize at the end of it. >>>> >>>> Ian >>>> >> >