This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with SSA form usign cgraph_nodes and push_cfun
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Massimo Nazaria <max_n at rocketmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 30 Apr 2010 10:41:57 +0200
- Subject: Re: Problem with SSA form usign cgraph_nodes and push_cfun
- References: <680134.33299.qm@web29004.mail.ird.yahoo.com>
On Thu, Apr 29, 2010 at 7:28 PM, Massimo Nazaria <max_n@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
>
>
>
>
>