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: Where can I get the output of the front-end.


On Thu, Apr 03, 2003 at 06:09:35PM +0200, Matthieu Moy wrote:
> What I would like to do is
> 
> C++ source -----> SSA tree ---(standard way)----> RTL
>                              \
>                               `---(my add-on)---> ...
> 
> So, I thought of  hacking the ssa -> rtl code, but  I can't find which
> function is doing so in gcc ! 
> 

The rtl is generated by the "emit_*" functions from expr.c
and "genrtl_*" functions from stmt.c

http://gcc.gnu.org/ml/gcc/2002-09/msg01051.html

But I think that what you're looking for is tree-optimize.c where 
you have the tree in the SSA representation: 


  /* Build the flowgraph.  */
  init_flow ();
  build_tree_cfg (fnbody);

  /* Begin analysis and optimization passes.  */
  if (n_basic_blocks > 0 && ! (errorcount || sorrycount))
    {
      /* Rewrite the function into SSA form.  */
      rewrite_into_ssa (fndecl);
      
      if (flag_tree_pre)
	tree_perform_ssapre (fndecl);

      if (flag_tree_ccp)
	tree_ssa_ccp (fndecl);
      
      if (flag_tree_copyprop)
	tree_ssa_copyprop (fndecl);

      if (flag_tree_dce)
	tree_ssa_dce (fndecl);
    }

  if (n_basic_blocks > 0 && ! (errorcount || sorrycount))
    {
      /* Rewrite the function out of SSA form.  */
      rewrite_out_of_ssa (fndecl);
    }


This code is reachable if you compile with -O2.


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