Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Massimo Nazaria
Thank you everyone!!! I found out a solution... I had to add a line to my pass (the 2nd if): for (node = cgraph_nodes; node; node = node->next) { if (node->analyzed && cgraph_is_master_clone (node)) { if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (node->decl))) return 0; // I added this line

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Diego Novillo
On Fri, Apr 30, 2010 at 10:48, Michael Matz wrote: >> For default SSA names, the defining statement will be NULL. > > Nope, it will be non-NULL but gimple_nop_p(). Bah! yes, of course. Sorry about that. Diego.

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Michael Matz
Hi, On Fri, 30 Apr 2010, Diego Novillo wrote: > On 4/30/10 09:35 , Massimo Nazaria wrote: > > > fprintf (dump_file, "gimple_code: %d\n", > > gimple_code (def_stmt)); // Here I get segmentation fault... > > For default SSA names, the defining statement will be

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Richard Guenther
On Fri, Apr 30, 2010 at 3:35 PM, Massimo Nazaria wrote: >> You'll have to post your work so people can see. Now the >> best the >> experts here can do is guess what you're holding behind >> your back :-) >> >> Ciao! >> Steven >> > > I completely agree with you. This is my pass: > > static unsigned

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Diego Novillo
On 4/30/10 09:35 , Massimo Nazaria wrote: > fprintf (dump_file, "gimple_code: %d\n", > gimple_code (def_stmt)); // Here I get segmentation fault... For default SSA names, the defining statement will be NULL. A default SSA name will be created when a symbol is n

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Massimo Nazaria
> The place where you insert the patch is as important as > the > implementation of your patch. What do your changes to > passes.c look > like? Here is the "passes.c": NEXT_PASS (pass_early_warn_uninitialized); NEXT_PASS (pass_all_early_optimizations); NEXT_PASS (pass_mypass); //

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Steven Bosscher
On Fri, Apr 30, 2010 at 3:35 PM, Massimo Nazaria wrote: >> You'll have to post your work so people can see. Now the >> best the >> experts here can do is guess what you're holding behind >> your back :-) >> >> Ciao! >> Steven >> > > I completely agree with you. This is my pass: The place where yo

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Massimo Nazaria
> You'll have to post your work so people can see. Now the > best the > experts here can do is guess what you're holding behind > your back :-) > > Ciao! > Steven > I completely agree with you. This is my pass: static unsigned int execute_mypass (void) { basic_block bb; gimple stmt, def_stm

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Steven Bosscher
On Fri, Apr 30, 2010 at 1:42 PM, Massimo Nazaria wrote: >> You have to schedule your IPA pass at a point where the >> whole >> program is in SSA form, which is during the regular IPA >> passes >> at earlierst. >> >> Richard. >> > > It does not work :( > I put my pass after all the ipa-passes and r

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Richard Guenther
On Fri, Apr 30, 2010 at 1:42 PM, Massimo Nazaria wrote: >> You have to schedule your IPA pass at a point where the >> whole >> program is in SSA form, which is during the regular IPA >> passes >> at earlierst. >> >> Richard. >> > > It does not work :( > I put my pass after all the ipa-passes and r

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Massimo Nazaria
> You have to schedule your IPA pass at a point where the > whole > program is in SSA form, which is during the regular IPA > passes > at earlierst. > > Richard. > It does not work :( I put my pass after all the ipa-passes and right before the optimization-passes. My problem occurs when I try t

Re: Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-30 Thread Richard Guenther
On Thu, Apr 29, 2010 at 7:28 PM, Massimo Nazaria wrote: > Hi everybody! > I am working on a gcc-pass which processes every statement using this code: > >  for (node = cgraph_nodes; node; node = node->next) >    { >      if (node->analyzed && cgraph_is_master_clone (node)) >        { >          pus

Problem with SSA form usign cgraph_nodes and push_cfun

2010-04-29 Thread Massimo Nazaria
Hi everybody! I am working on a gcc-pass which processes every statement using this code: for (node = cgraph_nodes; node; node = node->next) { if (node->analyzed && cgraph_is_master_clone (node)) { push_cfun (DECL_STRUCT_FUNCTION (node->decl)); FO