This is the mail archive of the gcc-patches@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] Merge results as of 2003-05-06


In message <20030507032001.GA5056@tornado.toronto.redhat.com>, Diego Novillo wr
ites:
 >-----------------------------------------------------------------------------
 >20030506/gcc.sum:
 >-----------------------------------------------------------------------------
 >FAIL: gcc.c-torture/execute/20011024-1.c compilation
 >FAIL: gcc.c-torture/execute/980526-1.c compilation
 >FAIL: gcc.misc-tests/bprob-2.c compilation
 >	 
 >    These have been introduced by the new remove_useless_stmts_and_vars
 >    In the case of 20011024-1.c, we are removing the
 >    FUNCTION_DECL for abort, which causes
 >    dwarf2out:add_abstract_origin_attribute to get very confused.
 >    I haven't looked at the other two, but they show the same
 >    error and are fixed if I undo the change.
The underlying problem is that we were removing the toplevel BIND_EXPR for
an inlined function.  Doing that confuses the living hell out of the dwarf2
code.

	* tree-cfg.c (remove_useless_stmts_and_vars): Do not remove
	the toplevel BIND_EXPR for an inlined function.

Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.83
diff -c -3 -p -r1.1.4.83 tree-cfg.c
*** tree-cfg.c	7 May 2003 02:49:49 -0000	1.1.4.83
--- tree-cfg.c	8 May 2003 03:24:31 -0000
*************** remove_useless_stmts_and_vars (first_p)
*** 1451,1464 ****
  	}
        else if (code == BIND_EXPR)
  	{
  	  /* First remove anything underneath the BIND_EXPR.  */
  	  repeat |= remove_useless_stmts_and_vars (&BIND_EXPR_BODY (*stmt_p));
  
  	  /* If the BIND_EXPR has no variables, then we can pull everything
  	     up one level and remove the BIND_EXPR, unless this is the
! 	     toplevel BIND_EXPR.  */
! 	  if (BIND_EXPR_VARS (*stmt_p) == NULL_TREE
! 	      && *stmt_p != DECL_SAVED_TREE (current_function_decl))
  	    *stmt_p = BIND_EXPR_BODY (*stmt_p);
  
  	  /* If we removed the BIND_EXPR completely and were left with
--- 1451,1471 ----
  	}
        else if (code == BIND_EXPR)
  	{
+ 	  tree block;
  	  /* First remove anything underneath the BIND_EXPR.  */
  	  repeat |= remove_useless_stmts_and_vars (&BIND_EXPR_BODY (*stmt_p));
  
  	  /* If the BIND_EXPR has no variables, then we can pull everything
  	     up one level and remove the BIND_EXPR, unless this is the
! 	     toplevel BIND_EXPR for the current function or an inlined
! 	     function.  */
! 	  block = BIND_EXPR_BLOCK (*stmt_p);
!   	  if (BIND_EXPR_VARS (*stmt_p) == NULL_TREE
! 	      && *stmt_p != DECL_SAVED_TREE (current_function_decl)
! 	      && (! block
! 		  || ! BLOCK_ABSTRACT_ORIGIN (block)
! 		  || (TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block))
! 		      != FUNCTION_DECL)))
  	    *stmt_p = BIND_EXPR_BODY (*stmt_p);
  
  	  /* If we removed the BIND_EXPR completely and were left with






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