This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to copy a control flow graph
- From: Deepak Aggrawal <deepak dot kansl at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 20 Jul 2013 00:42:50 +0530
- Subject: Re: How to copy a control flow graph
- References: <CAEO_aHKaUGV7THjGV7v3drrcUdX8g71y_N8_F=V+uYfrtX8EKw at mail dot gmail dot com>
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.