public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Saleel Kudchadker <skudchad@asu.edu>
Cc: gcc-help@gcc.gnu.org, gcc@gcc.gnu.org
Subject: Re: Segfault inserting a pass
Date: Thu, 18 Feb 2010 02:25:00 -0000	[thread overview]
Message-ID: <84fc9c001002171312l772b2e06o56973b18a84df559@mail.gmail.com> (raw)
In-Reply-To: <83eb93a1002171100o563a9fd7udf9568424137a06b@mail.gmail.com>

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
>

      reply	other threads:[~2010-02-17 21:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-17 19:14 Saleel Kudchadker
2010-02-18  2:25 ` Richard Guenther [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84fc9c001002171312l772b2e06o56973b18a84df559@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=skudchad@asu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).