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]

C++ PATCH for more function-at-a-time stuff



This patch continues to pave the way for the function-at-a-time
processing stuff by making sure we're handling the semantics of
statements that aren't full expressions correctly.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

1999-09-09  Mark Mitchell  <mark@codesourcery.com>

	* cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
	(STMT_IS_FULL_EXPR_P): Likewise.
	(STMT_LINENO_FOR_FN_P): Likewise.
	(prep_stmt): New function.
	(building_stmt_tree): Tweak for safety.
	* pt.c (tsubst_expr): Use prep_stmt throughout.
	(add_tree): Move it to semantics.c
	* semantics.c (add_tree): Move it here.
	(finish_expr_stmt_real): New function.
	(finish_expr_stmt): Use it.
	(finish_if_stmt_cond): Use FINISH_COND.
	(finish_while_stmt_cond): Likewise.
	(finish_for_cond): Likewise.
	(finish_stmt_tree): Tweak line-number handling.
	(prep_stmt): New function.
	(expand_stmt): Use it.

Index: cp-tree.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.295
diff -c -p -r1.295 cp-tree.h
*** cp-tree.h	1999/09/09 22:28:03	1.295
--- cp-tree.h	1999/09/09 23:16:26
*************** Boston, MA 02111-1307, USA.  */
*** 29,34 ****
--- 29,35 ----
  /* Usage of TREE_LANG_FLAG_?:
     0: BINFO_MARKED (BINFO nodes).
        COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT).
+       EXPR_STMT_ASSIGNS_THIS (in EXPR_STMT).
        NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
        DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
        LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR).
*************** Boston, MA 02111-1307, USA.  */
*** 49,60 ****
        INHERITED_VALUE_BINDING_P (in CPLUS_BINDING)
        BASELINK_P (in TREE_LIST)
        ICS_ELLIPSIS_FLAG (in _CONV)
     2: IDENTIFIER_OPNAME_P.
        BINFO_VBASE_MARKED.
        BINFO_FIELDS_MARKED.
        TYPE_VIRTUAL_P.
        ICS_THIS_FLAG (in _CONV)
!       BINDING_HAS_LEVEL_P (In CPLUS_BINDING)
     3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
        BINFO_VTABLE_PATH_MARKED.
        BINFO_PUSHDECLS_MARKED.
--- 50,63 ----
        INHERITED_VALUE_BINDING_P (in CPLUS_BINDING)
        BASELINK_P (in TREE_LIST)
        ICS_ELLIPSIS_FLAG (in _CONV)
+       STMT_IS_FULL_EXPR_P (in _STMT)
     2: IDENTIFIER_OPNAME_P.
        BINFO_VBASE_MARKED.
        BINFO_FIELDS_MARKED.
        TYPE_VIRTUAL_P.
        ICS_THIS_FLAG (in _CONV)
!       STMT_LINENO_FOR_FN_P (in _STMT)
!       BINDING_HAS_LEVEL_P (in CPLUS_BINDING)
     3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
        BINFO_VTABLE_PATH_MARKED.
        BINFO_PUSHDECLS_MARKED.
*************** struct lang_decl
*** 1816,1821 ****
--- 1819,1833 ----
     constructor call, rather than an ordinary function call.  */
  #define AGGR_INIT_VIA_CTOR_P(NODE) TREE_LANG_FLAG_0 (NODE)
  
+ /* Nonzero if this statement contained the first assigned to `this' in
+    the current function.  (Of course, one cannot assign to `this' in
+    ANSI/ISO C++, but we still support assignments to this with
+    -fthis-is-variable.)  */
+ #define EXPR_STMT_ASSIGNS_THIS(NODE) TREE_LANG_FLAG_0 ((NODE))
+ 
+ /* Nonzero if this statement should be considered a full-expression.  */
+ #define STMT_IS_FULL_EXPR_P(NODE) TREE_LANG_FLAG_1 ((NODE))
+ 
  /* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
     TEMPLATE_DECL.  This macro determines whether or not a given class
     type is really a template type, as opposed to an instantiation or
*************** extern int flag_new_for_scope;
*** 2430,2439 ****
  #define ASM_VOLATILE_P(NODE)			\
    (ASM_CV_QUAL ((NODE)) != NULL_TREE)
  
! /* The line-number at which a statement began.  */
  #define STMT_LINENO(NODE)			\
    (TREE_COMPLEXITY ((NODE)))
  
  /* The parameters for a call-declarator.  */
  #define CALL_DECLARATOR_PARMS(NODE) \
    (TREE_PURPOSE (TREE_OPERAND ((NODE), 1)))
--- 2442,2458 ----
  #define ASM_VOLATILE_P(NODE)			\
    (ASM_CV_QUAL ((NODE)) != NULL_TREE)
  
! /* The line-number at which a statement began.  But if
!    STMT_LINENO_FOR_FN_P does holds, then this macro gives the
!    line number for the end of the current function instead.  */
  #define STMT_LINENO(NODE)			\
    (TREE_COMPLEXITY ((NODE)))
  
+ /* If non-zero, the STMT_LINENO for NODE is the line at which the
+    function ended.  */
+ #define STMT_LINENO_FOR_FN_P(NODE) 		\
+   (TREE_LANG_FLAG_2 ((NODE)))
+ 
  /* The parameters for a call-declarator.  */
  #define CALL_DECLARATOR_PARMS(NODE) \
    (TREE_PURPOSE (TREE_OPERAND ((NODE), 1)))
*************** extern tree expand_stmt                 
*** 3635,3644 ****
  extern void expand_body                         PROTO((tree));
  extern void begin_stmt_tree                     PROTO((tree));
  extern void finish_stmt_tree                    PROTO((tree));
  /* Non-zero if we are presently building a statement tree, rather
     than expanding each statement as we encounter it.  */
! #define building_stmt_tree() \
!   (processing_template_decl || !expanding_p)
  
  /* in spew.c */
  extern void init_spew				PROTO((void));
--- 3654,3664 ----
  extern void expand_body                         PROTO((tree));
  extern void begin_stmt_tree                     PROTO((tree));
  extern void finish_stmt_tree                    PROTO((tree));
+ extern void prep_stmt                           PROTO((tree));
  /* Non-zero if we are presently building a statement tree, rather
     than expanding each statement as we encounter it.  */
! #define building_stmt_tree()					  \
!   (current_function && (processing_template_decl || !expanding_p))
  
  /* in spew.c */
  extern void init_spew				PROTO((void));
Index: pt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
retrieving revision 1.353
diff -c -p -r1.353 pt.c
*** pt.c	1999/09/09 22:28:13	1.353
--- pt.c	1999/09/09 23:16:33
*************** tsubst_expr (t, args, complain, in_decl)
*** 7235,7240 ****
--- 7235,7241 ----
    switch (TREE_CODE (t))
      {
      case RETURN_INIT:
+       prep_stmt (t);
        finish_named_return_value
  	(TREE_OPERAND (t, 0),
  	 tsubst_expr (TREE_OPERAND (t, 1), args, /*complain=*/1, in_decl));
*************** tsubst_expr (t, args, complain, in_decl)
*** 7242,7247 ****
--- 7243,7249 ----
        break;
  
      case CTOR_INITIALIZER:
+       prep_stmt (t);
        current_member_init_list
  	= tsubst_expr_values (TREE_OPERAND (t, 0), args);
        current_base_init_list
*************** tsubst_expr (t, args, complain, in_decl)
*** 7251,7263 ****
        break;
  
      case RETURN_STMT:
!       lineno = STMT_LINENO (t);
        finish_return_stmt (tsubst_expr (RETURN_EXPR (t),
  				       args, complain, in_decl));
        break;
  
      case EXPR_STMT:
!       lineno = STMT_LINENO (t);
        finish_expr_stmt (tsubst_expr (EXPR_STMT_EXPR (t),
  				     args, complain, in_decl));
        break;
--- 7253,7270 ----
        break;
  
      case RETURN_STMT:
!       prep_stmt (t);
        finish_return_stmt (tsubst_expr (RETURN_EXPR (t),
  				       args, complain, in_decl));
        break;
  
      case EXPR_STMT:
!       prep_stmt (t);
!       /* If we're doing tsubst'ing, then we should not yet have done
! 	 semantic analysisy, so we should not know that this statement
! 	 assigns to the `this' pointer.  */
!       my_friendly_assert (EXPR_STMT_ASSIGNS_THIS (t) == 0,
! 			  19990831);
        finish_expr_stmt (tsubst_expr (EXPR_STMT_EXPR (t),
  				     args, complain, in_decl));
        break;
*************** tsubst_expr (t, args, complain, in_decl)
*** 7268,7274 ****
  	tree decl;
  	tree init;
  
! 	lineno = STMT_LINENO (t);
  	decl = DECL_STMT_DECL (t);
  	if (TREE_CODE (decl) == LABEL_DECL)
  	  finish_label_decl (DECL_NAME (decl));
--- 7275,7281 ----
  	tree decl;
  	tree init;
  
! 	prep_stmt (t);
  	decl = DECL_STMT_DECL (t);
  	if (TREE_CODE (decl) == LABEL_DECL)
  	  finish_label_decl (DECL_NAME (decl));
*************** tsubst_expr (t, args, complain, in_decl)
*** 7296,7302 ****
      case FOR_STMT:
        {
  	tree tmp;
! 	lineno = STMT_LINENO (t);
  
  	stmt = begin_for_stmt ();
  	for (tmp = FOR_INIT_STMT (t); tmp; tmp = TREE_CHAIN (tmp))
--- 7303,7309 ----
      case FOR_STMT:
        {
  	tree tmp;
! 	prep_stmt (t);
  
  	stmt = begin_for_stmt ();
  	for (tmp = FOR_INIT_STMT (t); tmp; tmp = TREE_CHAIN (tmp))
*************** tsubst_expr (t, args, complain, in_decl)
*** 7314,7320 ****
  
      case WHILE_STMT:
        {
! 	lineno = STMT_LINENO (t);
  	stmt = begin_while_stmt ();
  	finish_while_stmt_cond (tsubst_expr (WHILE_COND (t),
  					     args, complain, in_decl),
--- 7321,7327 ----
  
      case WHILE_STMT:
        {
! 	prep_stmt (t);
  	stmt = begin_while_stmt ();
  	finish_while_stmt_cond (tsubst_expr (WHILE_COND (t),
  					     args, complain, in_decl),
*************** tsubst_expr (t, args, complain, in_decl)
*** 7326,7332 ****
  
      case DO_STMT:
        {
! 	lineno = STMT_LINENO (t);
  	stmt = begin_do_stmt ();
  	tsubst_expr (DO_BODY (t), args, complain, in_decl);
  	finish_do_body (stmt);
--- 7333,7339 ----
  
      case DO_STMT:
        {
! 	prep_stmt (t);
  	stmt = begin_do_stmt ();
  	tsubst_expr (DO_BODY (t), args, complain, in_decl);
  	finish_do_body (stmt);
*************** tsubst_expr (t, args, complain, in_decl)
*** 7340,7346 ****
        {
  	tree tmp;
  
! 	lineno = STMT_LINENO (t);
  	stmt = begin_if_stmt ();
  	finish_if_stmt_cond (tsubst_expr (IF_COND (t),
  					  args, complain, in_decl),
--- 7347,7353 ----
        {
  	tree tmp;
  
! 	prep_stmt (t);
  	stmt = begin_if_stmt ();
  	finish_if_stmt_cond (tsubst_expr (IF_COND (t),
  					  args, complain, in_decl),
*************** tsubst_expr (t, args, complain, in_decl)
*** 7367,7373 ****
        {
  	tree substmt;
  
! 	lineno = STMT_LINENO (t);
  	stmt = begin_compound_stmt (COMPOUND_STMT_NO_SCOPE (t));
  	for (substmt = COMPOUND_BODY (t); 
  	     substmt != NULL_TREE;
--- 7374,7380 ----
        {
  	tree substmt;
  
! 	prep_stmt (t);
  	stmt = begin_compound_stmt (COMPOUND_STMT_NO_SCOPE (t));
  	for (substmt = COMPOUND_BODY (t); 
  	     substmt != NULL_TREE;
*************** tsubst_expr (t, args, complain, in_decl)
*** 7378,7389 ****
        break;
  
      case BREAK_STMT:
!       lineno = STMT_LINENO (t);
        finish_break_stmt ();
        break;
  
      case CONTINUE_STMT:
!       lineno = STMT_LINENO (t);
        finish_continue_stmt ();
        break;
  
--- 7385,7396 ----
        break;
  
      case BREAK_STMT:
!       prep_stmt (t);
        finish_break_stmt ();
        break;
  
      case CONTINUE_STMT:
!       prep_stmt (t);
        finish_continue_stmt ();
        break;
  
*************** tsubst_expr (t, args, complain, in_decl)
*** 7391,7397 ****
        {
  	tree val;
  
! 	lineno = STMT_LINENO (t);
  	stmt = begin_switch_stmt ();
  	val = tsubst_expr (SWITCH_COND (t), args, complain, in_decl);
  	finish_switch_cond (val, stmt);
--- 7398,7404 ----
        {
  	tree val;
  
! 	prep_stmt (t);
  	stmt = begin_switch_stmt ();
  	val = tsubst_expr (SWITCH_COND (t), args, complain, in_decl);
  	finish_switch_cond (val, stmt);
*************** tsubst_expr (t, args, complain, in_decl)
*** 7401,7406 ****
--- 7408,7414 ----
        break;
  
      case CASE_LABEL:
+       prep_stmt (t);
        finish_case_label (tsubst_expr (CASE_LOW (t), args, complain, in_decl),
  			 tsubst_expr (CASE_HIGH (t), args, complain, in_decl));
        break;
*************** tsubst_expr (t, args, complain, in_decl)
*** 7411,7417 ****
        break;
  
      case GOTO_STMT:
!       lineno = STMT_LINENO (t);
        t = GOTO_DESTINATION (t);
        if (TREE_CODE (t) != LABEL_DECL)
  	/* Computed goto's must be tsubst'd into.  On the other hand,
--- 7419,7425 ----
        break;
  
      case GOTO_STMT:
!       prep_stmt (t);
        t = GOTO_DESTINATION (t);
        if (TREE_CODE (t) != LABEL_DECL)
  	/* Computed goto's must be tsubst'd into.  On the other hand,
*************** tsubst_expr (t, args, complain, in_decl)
*** 7424,7430 ****
        break;
  
      case ASM_STMT:
!       lineno = STMT_LINENO (t);
        finish_asm_stmt (ASM_CV_QUAL (t),
  		       tsubst_expr (ASM_STRING (t), args, complain, in_decl),
  		       tsubst_expr (ASM_OUTPUTS (t), args, complain, in_decl),
--- 7432,7438 ----
        break;
  
      case ASM_STMT:
!       prep_stmt (t);
        finish_asm_stmt (ASM_CV_QUAL (t),
  		       tsubst_expr (ASM_STRING (t), args, complain, in_decl),
  		       tsubst_expr (ASM_OUTPUTS (t), args, complain, in_decl),
*************** tsubst_expr (t, args, complain, in_decl)
*** 7434,7440 ****
        break;
  
      case TRY_BLOCK:
!       lineno = STMT_LINENO (t);
        stmt = begin_try_block ();
        tsubst_expr (TRY_STMTS (t), args, complain, in_decl);
        finish_try_block (stmt);
--- 7442,7448 ----
        break;
  
      case TRY_BLOCK:
!       prep_stmt (t);
        stmt = begin_try_block ();
        tsubst_expr (TRY_STMTS (t), args, complain, in_decl);
        finish_try_block (stmt);
*************** tsubst_expr (t, args, complain, in_decl)
*** 7452,7458 ****
        break;
  
      case HANDLER:
!       lineno = STMT_LINENO (t);
        stmt = begin_handler ();
        if (HANDLER_PARMS (t))
  	expand_start_catch_block
--- 7460,7466 ----
        break;
  
      case HANDLER:
!       prep_stmt (t);
        stmt = begin_handler ();
        if (HANDLER_PARMS (t))
  	expand_start_catch_block
*************** tsubst_expr (t, args, complain, in_decl)
*** 7466,7472 ****
        break;
  
      case TAG_DEFN:
!       lineno = STMT_LINENO (t);
        t = TREE_TYPE (t);
        if (TREE_CODE (t) == ENUMERAL_TYPE)
  	tsubst (t, args, complain, NULL_TREE);
--- 7474,7480 ----
        break;
  
      case TAG_DEFN:
!       prep_stmt (t);
        t = TREE_TYPE (t);
        if (TREE_CODE (t) == ENUMERAL_TYPE)
  	tsubst (t, args, complain, NULL_TREE);
*************** tsubst_expr_values (t, argvec)
*** 9852,9865 ****
      }
    return first;
  }
- 
- void
- add_tree (t)
-      tree t;
- {
-   last_tree = TREE_CHAIN (last_tree) = t;
- }
- 
  
  void
  begin_tree ()
--- 9860,9865 ----
Index: semantics.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/semantics.c,v
retrieving revision 1.75
diff -c -p -r1.75 semantics.c
*** semantics.c	1999/09/09 22:28:15	1.75
--- semantics.c	1999/09/09 23:16:34
*************** static tree expand_cond PROTO((tree));
*** 75,85 ****
        substmt = cond;				\
    } while (0)
    
! /* Finish an expression-statement, whose EXPRESSION is as indicated.  */
  
! void 
! finish_expr_stmt (expr)
       tree expr;
  {
    if (expr != NULL_TREE)
      {
--- 75,103 ----
        substmt = cond;				\
    } while (0)
    
! /* T is a statement.  Add it to the statement-tree.  */
  
! void
! add_tree (t)
!      tree t;
! {
!   /* Add T to the statement-tree.  */
!   last_tree = TREE_CHAIN (last_tree) = t;
! 
!   /* When we expand a statement-tree, we must know whether or not the
!      statements are full-expresions.  We record that fact here.  */
!   if (building_stmt_tree ())
!     STMT_IS_FULL_EXPR_P (last_tree) = stmts_are_full_exprs_p;
! }
! 
! /* Finish an expression-statement, whose EXPRESSION is as indicated.
!    If ASSIGNED_THIS is non-zero, then this statement just assigned to
!    the `this' pointer.  */
! 
! static void 
! finish_expr_stmt_real (expr, assigned_this)
       tree expr;
+      int assigned_this;
  {
    if (expr != NULL_TREE)
      {
*************** finish_expr_stmt (expr)
*** 109,114 ****
--- 127,137 ----
  	}
      }
  
+   /* If this statement assigned to the `this' pointer, record that
+      fact for finish_stmt.  */
+   if (assigned_this)
+     current_function_just_assigned_this = 1;
+ 
    finish_stmt ();
  
    /* This was an expression-statement, so we save the type of the
*************** finish_expr_stmt (expr)
*** 116,121 ****
--- 139,153 ----
    last_expr_type = expr ? TREE_TYPE (expr) : NULL_TREE;
  }
  
+ /* Like finish_expr_stmt_real, but ASSIGNS_THIS is always zero.  */
+ 
+ void
+ finish_expr_stmt (expr)
+      tree expr;
+ {
+   finish_expr_stmt_real (expr, /*assigns_this=*/0);
+ }
+ 
  /* Begin an if-statement.  Returns a newly created IF_STMT if
     appropriate.  */
  
*************** finish_if_stmt_cond (cond, if_stmt)
*** 146,157 ****
       tree if_stmt;
  {
    if (building_stmt_tree ())
!     {
!       if (last_tree != if_stmt)
! 	RECHAIN_STMTS_FROM_LAST (if_stmt, IF_COND (if_stmt));
!       else
! 	IF_COND (if_stmt) = cond;
!     }
    else
      {
        emit_line_note (input_filename, lineno);
--- 178,184 ----
       tree if_stmt;
  {
    if (building_stmt_tree ())
!     FINISH_COND (cond, if_stmt, IF_COND (if_stmt));
    else
      {
        emit_line_note (input_filename, lineno);
*************** finish_while_stmt_cond (cond, while_stmt
*** 244,255 ****
       tree while_stmt;
  {
    if (building_stmt_tree ())
!     {
!       if (last_tree != while_stmt)
! 	RECHAIN_STMTS_FROM_LAST (while_stmt, WHILE_COND (while_stmt)); 
!       else
! 	TREE_OPERAND (while_stmt, 0) = cond;
!     }
    else
      {
        emit_line_note (input_filename, lineno);
--- 271,277 ----
       tree while_stmt;
  {
    if (building_stmt_tree ())
!     FINISH_COND (cond, while_stmt, WHILE_COND (while_stmt));
    else
      {
        emit_line_note (input_filename, lineno);
*************** finish_for_cond (cond, for_stmt)
*** 409,420 ****
       tree for_stmt;
  {
    if (building_stmt_tree ())
!     {
!       if (last_tree != for_stmt)
! 	RECHAIN_STMTS_FROM_LAST (for_stmt, FOR_COND (for_stmt));
!       else
! 	FOR_COND (for_stmt) = cond;
!     }
    else
      {
        emit_line_note (input_filename, lineno);
--- 431,437 ----
       tree for_stmt;
  {
    if (building_stmt_tree ())
!     FINISH_COND (cond, for_stmt, FOR_COND (for_stmt));
    else
      {
        emit_line_note (input_filename, lineno);
*************** void
*** 1973,1981 ****
  finish_stmt_tree (fn)
       tree fn;
  {
!   DECL_SAVED_TREE (fn) = TREE_CHAIN (DECL_SAVED_TREE (fn));
  }
  
  /* Some statements, like for-statements or if-statements, require a
     condition.  This condition can be a declaration.  If T is such a
     declaration it is processed, and an expression appropriate to use
--- 1990,2019 ----
  finish_stmt_tree (fn)
       tree fn;
  {
!   tree stmt;
!   
!   /* Remove the fake extra statement added in begin_stmt_tree.  */
!   stmt = TREE_CHAIN (DECL_SAVED_TREE (fn));
!   DECL_SAVED_TREE (fn) = stmt;
! 
!   /* The line-number recorded in the outermost statement in a function
!      is the line number of the end of the function.  */
!   STMT_LINENO (stmt) = lineno;
!   STMT_LINENO_FOR_FN_P (stmt) = 1;
  }
  
+ /* We're about to expand T, a statement.  Set up appropriate context
+    for the substitution.  */
+ 
+ void
+ prep_stmt (t)
+      tree t;
+ {
+   if (!STMT_LINENO_FOR_FN_P (t))
+     lineno = STMT_LINENO (t);
+   stmts_are_full_exprs_p = STMT_IS_FULL_EXPR_P (t);
+ }
+ 
  /* Some statements, like for-statements or if-statements, require a
     condition.  This condition can be a declaration.  If T is such a
     declaration it is processed, and an expression appropriate to use
*************** tree
*** 2013,2031 ****
  expand_stmt (t)
       tree t;
  {
    if (t == NULL_TREE || t == error_mark_node)
      return NULL_TREE;
  
    switch (TREE_CODE (t))
      {
      case RETURN_STMT:
-       lineno = STMT_LINENO (t);
        finish_return_stmt (RETURN_EXPR (t));
        break;
  
      case EXPR_STMT:
!       lineno = STMT_LINENO (t);
!       finish_expr_stmt (EXPR_STMT_EXPR (t));
        break;
  
      case DECL_STMT:
--- 2051,2078 ----
  expand_stmt (t)
       tree t;
  {
+   int saved_stmts_are_full_exprs_p;
+   tree rval;
+ 
    if (t == NULL_TREE || t == error_mark_node)
      return NULL_TREE;
  
+   /* Assume we'll have nothing to return.  */
+   rval = NULL_TREE;
+ 
+   /* Set up context appropriately for handling this statement.  */
+   saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p;
+   prep_stmt (t);
+ 
    switch (TREE_CODE (t))
      {
      case RETURN_STMT:
        finish_return_stmt (RETURN_EXPR (t));
        break;
  
      case EXPR_STMT:
!       finish_expr_stmt_real (EXPR_STMT_EXPR (t),
! 			     EXPR_STMT_ASSIGNS_THIS (t));
        break;
  
      case DECL_STMT:
*************** expand_stmt (t)
*** 2064,2070 ****
        {
  	tree tmp;
  
- 	lineno = STMT_LINENO (t);
  	begin_for_stmt ();
  	for (tmp = FOR_INIT_STMT (t); tmp; tmp = TREE_CHAIN (tmp))
  	  expand_stmt (tmp);
--- 2111,2116 ----
*************** expand_stmt (t)
*** 2079,2085 ****
  
      case WHILE_STMT:
        {
- 	lineno = STMT_LINENO (t);
  	begin_while_stmt ();
  	finish_while_stmt_cond (expand_cond (WHILE_COND (t)), NULL_TREE);
  	expand_stmt (WHILE_BODY (t));
--- 2125,2130 ----
*************** expand_stmt (t)
*** 2089,2095 ****
  
      case DO_STMT:
        {
- 	lineno = STMT_LINENO (t);
  	begin_do_stmt ();
  	expand_stmt (DO_BODY (t));
  	finish_do_body (NULL_TREE);
--- 2134,2139 ----
*************** expand_stmt (t)
*** 2098,2104 ****
        break;
  
      case IF_STMT:
-       lineno = STMT_LINENO (t);
        begin_if_stmt ();
        finish_if_stmt_cond (expand_cond (IF_COND (t)), NULL_TREE);
        if (THEN_CLAUSE (t))
--- 2142,2147 ----
*************** expand_stmt (t)
*** 2116,2134 ****
        break;
  
      case COMPOUND_STMT:
-       lineno = STMT_LINENO (t);
        begin_compound_stmt (COMPOUND_STMT_NO_SCOPE (t));
        expand_stmts (COMPOUND_BODY (t));
!       return finish_compound_stmt (COMPOUND_STMT_NO_SCOPE (t), 
  				   NULL_TREE);
  
      case BREAK_STMT:
-       lineno = STMT_LINENO (t);
        finish_break_stmt ();
        break;
  
      case CONTINUE_STMT:
-       lineno = STMT_LINENO (t);
        finish_continue_stmt ();
        break;
  
--- 2159,2175 ----
        break;
  
      case COMPOUND_STMT:
        begin_compound_stmt (COMPOUND_STMT_NO_SCOPE (t));
        expand_stmts (COMPOUND_BODY (t));
!       rval = finish_compound_stmt (COMPOUND_STMT_NO_SCOPE (t), 
  				   NULL_TREE);
+       break;
  
      case BREAK_STMT:
        finish_break_stmt ();
        break;
  
      case CONTINUE_STMT:
        finish_continue_stmt ();
        break;
  
*************** expand_stmt (t)
*** 2136,2142 ****
        {
  	tree cond;
  
- 	lineno = STMT_LINENO (t);
  	begin_switch_stmt ();
  	cond = expand_cond (SWITCH_COND (t));
  	finish_switch_cond (cond, NULL_TREE);
--- 2177,2182 ----
*************** expand_stmt (t)
*** 2150,2161 ****
        break;
  
      case LABEL_STMT:
-       lineno = STMT_LINENO (t);
        finish_label_stmt (DECL_NAME (LABEL_STMT_LABEL (t)));
        break;
  
      case GOTO_STMT:
-       lineno = STMT_LINENO (t);
        if (TREE_CODE (GOTO_DESTINATION (t)) == LABEL_DECL)
  	finish_goto_stmt (DECL_NAME (GOTO_DESTINATION (t)));
        else
--- 2190,2199 ----
*************** expand_stmt (t)
*** 2163,2175 ****
        break;
  
      case ASM_STMT:
-       lineno = STMT_LINENO (t);
        finish_asm_stmt (ASM_CV_QUAL (t), ASM_STRING (t), ASM_OUTPUTS
  		       (t), ASM_INPUTS (t), ASM_CLOBBERS (t));
        break;
  
      case TRY_BLOCK:
-       lineno = STMT_LINENO (t);
        if (CLEANUP_P (t))
  	{
  	  expand_eh_region_start ();
--- 2201,2211 ----
*************** expand_stmt (t)
*** 2187,2193 ****
        break;
  
      case HANDLER:
-       lineno = STMT_LINENO (t);
        begin_handler ();
        if (HANDLER_PARMS (t))
  	expand_start_catch_block (DECL_STMT_DECL (HANDLER_PARMS (t)));
--- 2223,2228 ----
*************** expand_stmt (t)
*** 2199,2205 ****
        break;
  
      case SUBOBJECT:
-       lineno = STMT_LINENO (t);
        finish_subobject (SUBOBJECT_CLEANUP (t));
        break;
  
--- 2234,2239 ----
*************** expand_stmt (t)
*** 2208,2214 ****
        break;
      }
  
!   return NULL_TREE;
  }
  
  /* Generate RTL for FN.  */
--- 2242,2251 ----
        break;
      }
  
!   /* Restore saved state.  */
!   stmts_are_full_exprs_p = saved_stmts_are_full_exprs_p;
! 
!   return rval;
  }
  
  /* Generate RTL for FN.  */


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