This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to copy a control flow graph


I am trying to copy a function like this-

struct cgraph_node *dup_node, *cur_node=cgraph_get_node(current_function_decl);
dup_node=cgraph_function_versioning(cur_node,NULL,NULL,NULL,0,NULL,NULL,"duplicate");

But it is giving error-
In file included from :1:0:
test.c:3:5: internal compiler error: in execute_one_pass, at passes.c:2026

The lines near 2026 in passes.c are-
  /* IPA passes are executed on whole program, so cfun should be NULL.
     Other passes need function context set.  */
  if (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS)
    gcc_assert (!cfun && !current_function_decl);
  else
2026:    gcc_assert (cfun && current_function_decl);

How do I solve this problem? Am I doing right by using
cgraph_function_versioning() function?


On Fri, Jul 19, 2013 at 11:23 PM, Deepak Aggrawal
<deepak.kansl@gmail.com> wrote:
> hi,
>  I need to copy a whole control flow graph for a function in my
> plugin. Is there any function provided by gcc that does that?
> Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]