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: [tree-ssa] Tree browser unstable ?


On Thu, Apr 03, 2003 at 08:26:48AM -0500, Diego Novillo wrote:
> On Thu, 2003-04-03 at 08:02, Matthieu Moy wrote:
> > It is  an interesting option,  but I find  it very unstable.  I rather
> > often get error messages like this :
> > 
> Not surprising.  The tree browser is an experimental feature.  You're
> essentially using the initial revision of the code.
> 
This could also happen if the function's trees are not available: 
have a look at the value of current_function_decl: 

/* The FUNCTION_DECL for the function currently being compiled,
   or 0 if between functions.  */
tree current_function_decl;


It is also possible that there are some errors in the browser's code: 
I didn't tested it on the c++ front-end.
The walk_tree is mainly used for registering the information about the 
parent expressions, but you can use the browser without the "up" commands. 

Try for example the following patch: 


Index: tree-browser.c
===================================================================
RCS file: /home/pop/cvsroot/gcc-cvs/gcc/gcc/Attic/tree-browser.c,v
retrieving revision 1.1.2.2
diff -u -3 -p -c -r1.1.2.2 tree-browser.c
*** tree-browser.c	3 Dec 2002 22:54:32 -0000	1.1.2.2
--- tree-browser.c	3 Apr 2003 14:26:38 -0000
*************** TB_parent_eq (p1, p2)
*** 873,893 ****
   
  static void 
  TB_update_up (node) 
!      tree node; 
  { 
-   while (node) 
-     { 
-       walk_tree (&node, store_child_info, NULL, NULL); 
-  
-       /* Walk function's body.  */ 
-       if (TREE_CODE (node) == FUNCTION_DECL) 
-         if (DECL_SAVED_TREE (node)) 
-           walk_tree (&DECL_SAVED_TREE (node), store_child_info, NULL, NULL); 
-       
-       /* Walk rest of the chain.  */ 
-       node = TREE_CHAIN (node);
-     } 
-   fprintf (TB_OUT_FILE, "Up/prev expressions updated.\n"); 
  } 
  
  /* Parse the input string for determining the command the user asked for.  */
--- 873,880 ----
   
  static void 
  TB_update_up (node) 
!      tree node ATTRIBUTE_UNUSED; 
  { 
  } 
  
  /* Parse the input string for determining the command the user asked for.  */


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