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] live analysis on local static functions


> On Tue, 2003-10-14 at 12:10, Jan Hubicka wrote:
> 
> > so we miss the initializer.  I've tracked down the problem to fact that
> > variable a does not have flag used set in it's annotation.  It has, when
> > I disable the inlining.  It is marked in create_ssa_var_map by seeing
> > VUSE attached to the return statement.  With inline enabled the set also
> > has VUSE but it's operand is not VAR_DECL itself, but SSA_NAME
> > 
> 
> 
> I assume the useless stmt remover ought to check to see if there is a
> static initializer in a BIND_EXPR before removing a DECL with an
> initializer which is not marked used.    
> 
> Either that, or has_hidden_use() ought to be set on A.
> 
> Neither is true right now.
> 
> There are other choices too :-)

This is patch I use in my tree.  Would be OK to apply it?

Tue Oct 14 18:51:47 CEST 2003  Jan Hubicka  <jh@suse.cz>
	* tree-cfg.c (remove-useless_stmts_and_vars_bind): Fix handling of
	local static variables.
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.173
diff -c -3 -p -r1.1.4.173 tree-cfg.c
*** tree-cfg.c	6 Oct 2003 14:34:25 -0000	1.1.4.173
--- tree-cfg.c	14 Oct 2003 16:51:34 -0000
*************** remove_useless_stmts_and_vars_bind (tree
*** 1382,1389 ****
  	  struct var_ann_d *ann;
  
  	  /* We could have function declarations and the like
! 	     on this list.  Ignore them.  */
! 	  if (TREE_CODE (vars) != VAR_DECL)
  	    {
  	      prev_var = vars;
  	      continue;
--- 1382,1393 ----
  	  struct var_ann_d *ann;
  
  	  /* We could have function declarations and the like
! 	     on this list.  Ignore them. Also we must not remove
! 	     static initializers.  ??? The local static variables
! 	     should be dealt with similarly to global static variables.  */
! 	     */
! 	  if (TREE_CODE (vars) != VAR_DECL
! 	      || TREE_STATIC (vars))
  	    {
  	      prev_var = vars;
  	      continue;


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