On Thu, Apr 29, 2010 at 7:28 PM, Massimo Nazaria <ma...@rocketmail.com> 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)) > { > push_cfun (DECL_STRUCT_FUNCTION (node->decl)); > > FOR_EACH_BB (bb) > { > // Here I would like to use SSA_NAME_DEF_STMT (gimple_assign_rhs1 > (stmt)); > > > With the code above I can't use SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt)) > (I get 'segmentation fault'). I think the reason is that the statements are > not in SSA-form. > > Insead, if I use > > FOR_EACH_BB (bb) { ... } > > without using "for (node = graph_nodes; ...", I have the statements in > SSA-form and SSA_NAME_DEF_STMT is OK. > > Unfortunately, with this solution, I can not process every function at once... > > How can I do to use SSA_NAME_DEF_STMT while processing every function?
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. > Thank you! > > Max > > > > >