This is the mail archive of the gcc@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: Segfault inserting a pass


On Wed, Feb 17, 2010 at 8:00 PM, Saleel Kudchadker <skudchad@asu.edu> wrote:
> Hi I am working on calling the instrument function before every
> function call automatically. I tried inserting this pass which would
> add my function to every edge
>
> //----------------------------------------
>
> static unsigned int spmm_insert(void){
>
>
> ?struct cgraph_edge *e;
> ?struct cgraph_node *node = cgraph_node (current_function_decl);
>
> tree x, bind,spmm_type,spmm_decl,ctr_ptr;
> x = implicit_built_in_decls[BUILT_IN_PROFILE_FUNC_ENTER];
> x = build_call_expr (x, 0);
>
> ?for (e = node->callees; e; e = e->next_callee){
> bsi_insert_on_edge(e, x);
> }

e is a callgraph edge, not an edge in the CFG - that doesn't work and
warnings when compiling the code would have shown that to you.

Richard.

>
> /*******************************************************/
>
> This throws me a Segfault error when compiling the code. i am applying
> this pass before pass_apply_inline in passes.c
> I am new to GCC, Can someone hint me documents or materials I can look
> upon to insert this pass.
>
>
> --
> Regards,
>
> Saleel Kudchadker
> Graduate Student
> School of Computing , Informatics and Decision Systems
> Arizona State University
>


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