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]

[ast-optimizer-branch] PATCH to remove simplify_expr variants


At Diego's request.  Tested i686-pc-linux-gnu.

2002-06-12  Jason Merrill  <jason@redhat.com>

	* c-simplify.c (fallback_t): New enum.
	(simplify_expr): Rename from simplify_expr_common.  FALLBACK parm
	is now of fallback_t type.
	(simplify_lvalue_expr, simplify_expr, simplify_expr_either): Lose.
	(most everything): Adjust.

*** c-simplify.c.~1~	Wed Jun 12 17:18:15 2002
--- c-simplify.c	Wed Jun 12 17:56:27 2002
*************** static void simplify_do_stmt         PAR
*** 62,71 ****
  static void simplify_if_stmt         PARAMS ((tree, tree *));
  static void simplify_switch_stmt     PARAMS ((tree, tree *));
  static void simplify_return_stmt     PARAMS ((tree, tree *));
! static void simplify_expr_common     PARAMS ((tree *, tree *, tree *,
!                                               int (*) PARAMS ((tree)), tree, int));
! static void simplify_expr            PARAMS ((tree *, tree *, tree *,
!                                               int (*) PARAMS ((tree)), tree));
  static void simplify_array_ref       PARAMS ((tree *, tree *, tree *, tree));
  static void simplify_compound_lval   PARAMS ((tree *, tree *, tree *, tree));
  static void simplify_self_mod_expr   PARAMS ((tree *, tree *, tree *, tree));
--- 62,75 ----
  static void simplify_if_stmt         PARAMS ((tree, tree *));
  static void simplify_switch_stmt     PARAMS ((tree, tree *));
  static void simplify_return_stmt     PARAMS ((tree, tree *));
! typedef enum fallback_t {
!   fb_rvalue=1,
!   fb_lvalue=2,
!   fb_either=1|2
! } fallback_t;
! static void simplify_expr	     PARAMS ((tree *, tree *, tree *,
!                                               int (*) PARAMS ((tree)), tree,
! 					      fallback_t));
  static void simplify_array_ref       PARAMS ((tree *, tree *, tree *, tree));
  static void simplify_compound_lval   PARAMS ((tree *, tree *, tree *, tree));
  static void simplify_self_mod_expr   PARAMS ((tree *, tree *, tree *, tree));
*************** static void simplify_boolean_expr    PAR
*** 78,85 ****
  static void simplify_compound_expr   PARAMS ((tree *, tree *, tree *, tree));
  static void simplify_expr_wfl        PARAMS ((tree *, tree *, tree *,
                                                int (*) PARAMS ((tree)), tree));
- static void simplify_lvalue_expr     PARAMS ((tree *, tree *, tree *,
- 					      int (*) PARAMS ((tree)), tree));
  static void make_type_writable       PARAMS ((tree));
  static tree add_tree                 PARAMS ((tree, tree *));
  static tree insert_before_continue   PARAMS ((tree, tree));
--- 82,87 ----
*************** simplify_stmt (stmt)
*** 241,247 ****
  
  	  walk_tree (&EXPR_STMT_EXPR (stmt), mostly_copy_tree_r, NULL, NULL);
  	  simplify_expr (&EXPR_STMT_EXPR (stmt), &pre, &post, is_simple_expr,
! 	                 stmt);
  	  break;
  
  	case RETURN_STMT:
--- 243,249 ----
  
  	  walk_tree (&EXPR_STMT_EXPR (stmt), mostly_copy_tree_r, NULL, NULL);
  	  simplify_expr (&EXPR_STMT_EXPR (stmt), &pre, &post, is_simple_expr,
! 	                 stmt, fb_rvalue);
  	  break;
  
  	case RETURN_STMT:
*************** simplify_for_stmt (stmt, pre_p)
*** 429,439 ****
  	    to emit PRE_INIT_S, INIT_S, POST_INIT_S and PRE_COND_S into a
  	    COMPOUND_EXPR inside FOR_INIT_STMT.  However, this is not
  	    possible if any of these elements contains statement trees.  */
!   simplify_expr (&init_s, &pre_init_s, &post_init_s, is_simple_expr, stmt);
  
    /* Simplify FOR_COND.  */
    if (!cond_is_simple)
!     simplify_expr (&cond_s, &pre_cond_s, NULL, is_simple_condexpr, stmt);
  
    /* Simplify the body of the loop.  */
    simplify_stmt (FOR_BODY (stmt));
--- 431,443 ----
  	    to emit PRE_INIT_S, INIT_S, POST_INIT_S and PRE_COND_S into a
  	    COMPOUND_EXPR inside FOR_INIT_STMT.  However, this is not
  	    possible if any of these elements contains statement trees.  */
!   simplify_expr (&init_s, &pre_init_s, &post_init_s, is_simple_expr,
! 		 stmt, fb_rvalue);
  
    /* Simplify FOR_COND.  */
    if (!cond_is_simple)
!     simplify_expr (&cond_s, &pre_cond_s, NULL, is_simple_condexpr,
! 		   stmt, fb_rvalue);
  
    /* Simplify the body of the loop.  */
    simplify_stmt (FOR_BODY (stmt));
*************** simplify_for_stmt (stmt, pre_p)
*** 442,448 ****
       it's converted into a simple_expr because we need to move it out of
       the loop header (see previous FIXME note for future enhancement).  */
    if (!expr_is_simple)
!     simplify_expr (&expr_s, &pre_expr_s, &post_expr_s, is_simple_expr, stmt);
    
  
    /* Now that all the components are simplified, we have to build a new
--- 446,453 ----
       it's converted into a simple_expr because we need to move it out of
       the loop header (see previous FIXME note for future enhancement).  */
    if (!expr_is_simple)
!     simplify_expr (&expr_s, &pre_expr_s, &post_expr_s, is_simple_expr,
! 		   stmt, fb_rvalue);
    
  
    /* Now that all the components are simplified, we have to build a new
*************** simplify_while_stmt (stmt, pre_p)
*** 604,610 ****
    /* Simplify the loop conditional.  */
    cond_s = WHILE_COND (stmt);
    walk_tree (&cond_s, mostly_copy_tree_r, NULL, NULL);
!   simplify_expr (&cond_s, pre_p, NULL, is_simple_condexpr, stmt);
    WHILE_COND (stmt) = cond_s;
  
    /* Simplify the body of the loop.  */
--- 609,615 ----
    /* Simplify the loop conditional.  */
    cond_s = WHILE_COND (stmt);
    walk_tree (&cond_s, mostly_copy_tree_r, NULL, NULL);
!   simplify_expr (&cond_s, pre_p, NULL, is_simple_condexpr, stmt, fb_rvalue);
    WHILE_COND (stmt) = cond_s;
  
    /* Simplify the body of the loop.  */
*************** simplify_do_stmt (stmt)
*** 669,675 ****
    pre_cond_s = NULL;
    cond_s = DO_COND (stmt);
    walk_tree (&cond_s, mostly_copy_tree_r, NULL, NULL);
!   simplify_expr (&cond_s, &pre_cond_s, NULL, is_simple_condexpr, stmt);
    DO_COND (stmt) = cond_s;
  
    stmt_chain = convert_to_stmt_chain (deep_copy_list (pre_cond_s), stmt);
--- 674,681 ----
    pre_cond_s = NULL;
    cond_s = DO_COND (stmt);
    walk_tree (&cond_s, mostly_copy_tree_r, NULL, NULL);
!   simplify_expr (&cond_s, &pre_cond_s, NULL, is_simple_condexpr,
! 		 stmt, fb_rvalue);
    DO_COND (stmt) = cond_s;
  
    stmt_chain = convert_to_stmt_chain (deep_copy_list (pre_cond_s), stmt);
*************** simplify_if_stmt (stmt, pre_p)
*** 731,737 ****
        /* Simplify the conditional.  */
        cond_s = IF_COND (stmt);
        walk_tree (&cond_s, mostly_copy_tree_r, NULL, NULL);
!       simplify_expr (&cond_s, pre_p, NULL, is_simple_condexpr, stmt);
        IF_COND (stmt) = cond_s;
      }
  
--- 737,744 ----
        /* Simplify the conditional.  */
        cond_s = IF_COND (stmt);
        walk_tree (&cond_s, mostly_copy_tree_r, NULL, NULL);
!       simplify_expr (&cond_s, pre_p, NULL, is_simple_condexpr,
! 		     stmt, fb_rvalue);
        IF_COND (stmt) = cond_s;
      }
  
*************** simplify_switch_stmt (stmt, pre_p)
*** 780,786 ****
      {
        /* Simplify the conditional.  */
        walk_tree (&SWITCH_COND (stmt), mostly_copy_tree_r, NULL, NULL);
!       simplify_expr (&SWITCH_COND (stmt), pre_p, NULL, is_simple_val, stmt);
      }
  
    simplify_stmt (SWITCH_BODY (stmt));
--- 787,794 ----
      {
        /* Simplify the conditional.  */
        walk_tree (&SWITCH_COND (stmt), mostly_copy_tree_r, NULL, NULL);
!       simplify_expr (&SWITCH_COND (stmt), pre_p, NULL, is_simple_val,
! 		     stmt, fb_rvalue);
      }
  
    simplify_stmt (SWITCH_BODY (stmt));
*************** simplify_return_stmt (stmt, pre_p)
*** 818,824 ****
  	return;
  
        walk_tree (&ret_expr, mostly_copy_tree_r, NULL, NULL);
!       simplify_expr (&ret_expr, pre_p, NULL, is_simple_rhs, stmt);
        TREE_OPERAND (RETURN_EXPR (stmt), 1) = ret_expr;
      }
  }
--- 826,832 ----
  	return;
  
        walk_tree (&ret_expr, mostly_copy_tree_r, NULL, NULL);
!       simplify_expr (&ret_expr, pre_p, NULL, is_simple_rhs, stmt, fb_rvalue);
        TREE_OPERAND (RETURN_EXPR (stmt), 1) = ret_expr;
      }
  }
*************** simplify_return_stmt (stmt, pre_p)
*** 857,872 ****
          If both are set, either is OK, but an lvalue is preferable.  */
  
  static void
! simplify_expr_common (expr_p, pre_p, post_p, simple_test_f, stmt, fallback)
       tree *expr_p;
       tree *pre_p;
       tree *post_p;
       int (*simple_test_f) PARAMS ((tree));
       tree stmt;
!      int fallback;
  {
-   int fallback_rvalue = (fallback & 1);
-   int fallback_lvalue = (fallback & 2);
    tree tmp;
    tree internal_post = NULL_TREE;
  
--- 865,878 ----
          If both are set, either is OK, but an lvalue is preferable.  */
  
  static void
! simplify_expr (expr_p, pre_p, post_p, simple_test_f, stmt, fallback)
       tree *expr_p;
       tree *pre_p;
       tree *post_p;
       int (*simple_test_f) PARAMS ((tree));
       tree stmt;
!      fallback_t fallback;
  {
    tree tmp;
    tree internal_post = NULL_TREE;
  
*************** simplify_expr_common (expr_p, pre_p, pos
*** 916,923 ****
  
      case REALPART_EXPR:
      case IMAGPART_EXPR:
!       simplify_expr_common (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 			    simple_test_f, stmt, fallback);
        return;
  
      case MODIFY_EXPR:
--- 922,929 ----
  
      case REALPART_EXPR:
      case IMAGPART_EXPR:
!       simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 		     simple_test_f, stmt, fallback);
        return;
  
      case MODIFY_EXPR:
*************** simplify_expr_common (expr_p, pre_p, pos
*** 931,943 ****
  
      case TRUTH_NOT_EXPR:
        tmp = TREE_OPERAND (*expr_p, 0);
!       simplify_expr (&tmp, pre_p, post_p, is_simple_id, stmt);
        *expr_p = build (EQ_EXPR, TREE_TYPE (*expr_p), tmp, integer_zero_node);
        break;
  
      case ADDR_EXPR:
!       simplify_lvalue_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 			    is_simple_varname, stmt);
        break;
  
      /* va_arg expressions should also be left alone to avoid confusing the
--- 937,949 ----
  
      case TRUTH_NOT_EXPR:
        tmp = TREE_OPERAND (*expr_p, 0);
!       simplify_expr (&tmp, pre_p, post_p, is_simple_id, stmt, fb_rvalue);
        *expr_p = build (EQ_EXPR, TREE_TYPE (*expr_p), tmp, integer_zero_node);
        break;
  
      case ADDR_EXPR:
!       simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 		     is_simple_varname, stmt, fb_lvalue);
        break;
  
      /* va_arg expressions should also be left alone to avoid confusing the
*************** simplify_expr_common (expr_p, pre_p, pos
*** 952,968 ****
      case FIX_FLOOR_EXPR:
      case FIX_ROUND_EXPR:
        simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 	             is_simple_varname, stmt);
        break;
  
      case INDIRECT_REF:
        simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, is_simple_id,
! 	             stmt);
        break;
  
      case NEGATE_EXPR:
        simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, is_simple_val,
! 	             stmt);
        break;
  
      /* Constants need not be simplified.  */
--- 958,974 ----
      case FIX_FLOOR_EXPR:
      case FIX_ROUND_EXPR:
        simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 	             is_simple_varname, stmt, fb_rvalue);
        break;
  
      case INDIRECT_REF:
        simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, is_simple_id,
! 	             stmt, fb_rvalue);
        break;
  
      case NEGATE_EXPR:
        simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, is_simple_val,
! 	             stmt, fb_rvalue);
        break;
  
      /* Constants need not be simplified.  */
*************** simplify_expr_common (expr_p, pre_p, pos
*** 992,998 ****
         eliminated.  */
      case SAVE_EXPR:
        simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, is_simple_id,
! 	             stmt);
        *expr_p = TREE_OPERAND (*expr_p, 0);
        break;
  
--- 998,1004 ----
         eliminated.  */
      case SAVE_EXPR:
        simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, is_simple_id,
! 	             stmt, fb_rvalue);
        *expr_p = TREE_OPERAND (*expr_p, 0);
        break;
  
*************** simplify_expr_common (expr_p, pre_p, pos
*** 1013,1019 ****
  
      case NON_LVALUE_EXPR:
        simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, simple_test_f,
! 	             stmt);
        break;
  
      /* If *EXPR_P does not need to be special-cased, handle it according to
--- 1019,1025 ----
  
      case NON_LVALUE_EXPR:
        simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, simple_test_f,
! 	             stmt, fb_rvalue);
        break;
  
      /* If *EXPR_P does not need to be special-cased, handle it according to
*************** simplify_expr_common (expr_p, pre_p, pos
*** 1023,1029 ****
  	if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '1')
  	  {
  	    simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 	                   is_simple_val, stmt);
  	  }
  	else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '2'
  	         || TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '<'
--- 1029,1035 ----
  	if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '1')
  	  {
  	    simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 	                   is_simple_val, stmt, fb_rvalue);
  	  }
  	else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '2'
  	         || TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '<'
*************** simplify_expr_common (expr_p, pre_p, pos
*** 1032,1041 ****
  		 || TREE_CODE (*expr_p) == TRUTH_XOR_EXPR)
  	  {
  	    simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 			   is_simple_val, stmt);
  
  	    simplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p,
! 			   is_simple_val, stmt);
  	  }
  	else
  	  {
--- 1038,1047 ----
  		 || TREE_CODE (*expr_p) == TRUTH_XOR_EXPR)
  	  {
  	    simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 			   is_simple_val, stmt, fb_rvalue);
  
  	    simplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p,
! 			   is_simple_val, stmt, fb_rvalue);
  	  }
  	else
  	  {
*************** simplify_expr_common (expr_p, pre_p, pos
*** 1056,1071 ****
       expression.  */
  
    /* We can't return an lvalue if we have an internal postqueue.  */
!   if (fallback_lvalue && !internal_post && is_simple_varname (*expr_p))
      {
        /* An lvalue will do.  Take the address of the expression, store it
  	 in a temporary, and replace the expression with an INDIRECT_REF of
  	 that temporary.  */
        tmp = build_addr_expr (*expr_p);
!       simplify_expr (&tmp, pre_p, post_p, is_simple_id, stmt);
        *expr_p = build_indirect_ref (tmp, "");
      }
!   else if (fallback_rvalue && is_simple_rhs (*expr_p))
      {
        if (VOID_TYPE_P (TREE_TYPE (*expr_p)))
  	abort ();
--- 1062,1077 ----
       expression.  */
  
    /* We can't return an lvalue if we have an internal postqueue.  */
!   if ((fallback & fb_lvalue) && !internal_post && is_simple_varname (*expr_p))
      {
        /* An lvalue will do.  Take the address of the expression, store it
  	 in a temporary, and replace the expression with an INDIRECT_REF of
  	 that temporary.  */
        tmp = build_addr_expr (*expr_p);
!       simplify_expr (&tmp, pre_p, post_p, is_simple_id, stmt, fb_rvalue);
        *expr_p = build_indirect_ref (tmp, "");
      }
!   else if ((fallback & fb_rvalue) && is_simple_rhs (*expr_p))
      {
        if (VOID_TYPE_P (TREE_TYPE (*expr_p)))
  	abort ();
*************** simplify_expr_common (expr_p, pre_p, pos
*** 1090,1133 ****
      add_tree (internal_post, pre_p);
  }
  
- static void
- simplify_expr (expr_p, pre_p, post_p, simple_test_f, stmt)
-      tree *expr_p;
-      tree *pre_p;
-      tree *post_p;
-      int (*simple_test_f) PARAMS ((tree));
-      tree stmt;
- {
-   simplify_expr_common (expr_p, pre_p, post_p, simple_test_f, stmt, 1);
- }
- 
- static void
- simplify_lvalue_expr (expr_p, pre_p, post_p, simple_test_f, stmt)
-      tree *expr_p;
-      tree *pre_p;
-      tree *post_p;
-      int (*simple_test_f) PARAMS ((tree));
-      tree stmt;
- {
-   simplify_expr_common (expr_p, pre_p, post_p, simple_test_f, stmt, 2);
- }
- 
- #if 0
- static void simplify_expr_either     PARAMS ((tree *, tree *, tree *,
-                                               int (*) PARAMS ((tree)), tree));
- static void
- simplify_expr_either (expr_p, pre_p, post_p, simple_test_f, stmt)
-      tree *expr_p;
-      tree *pre_p;
-      tree *post_p;
-      int (*simple_test_f) PARAMS ((tree));
-      tree stmt;
- {
-   simplify_expr_common (expr_p, pre_p, post_p, simple_test_f, stmt, 1|2);
- }
- #endif
- 
- 
  /** Build an expression for the address of T.  Folds away INDIRECT_REF to
      avoid confusing the simplify process.  */
  
--- 1096,1101 ----
*************** simplify_array_ref (expr_p, pre_p, post_
*** 1197,1208 ****
       Simplify the base, and then each of the dimensions from left to
       right.  */
  
!   simplify_lvalue_expr (p, pre_p, post_p, is_simple_min_lval, stmt);
  
    for (; VARRAY_ACTIVE_SIZE (dim_stack) > 0; VARRAY_POP (dim_stack))
      {
        tree *dim_p = (tree *)VARRAY_TOP_GENERIC_PTR (dim_stack);
!       simplify_expr (dim_p, pre_p, post_p, is_simple_val, stmt);
      }
  
    VARRAY_FREE (dim_stack);
--- 1165,1176 ----
       Simplify the base, and then each of the dimensions from left to
       right.  */
  
!   simplify_expr (p, pre_p, post_p, is_simple_min_lval, stmt, fb_lvalue);
  
    for (; VARRAY_ACTIVE_SIZE (dim_stack) > 0; VARRAY_POP (dim_stack))
      {
        tree *dim_p = (tree *)VARRAY_TOP_GENERIC_PTR (dim_stack);
!       simplify_expr (dim_p, pre_p, post_p, is_simple_val, stmt, fb_rvalue);
      }
  
    VARRAY_FREE (dim_stack);
*************** simplify_compound_lval (expr_p, pre_p, p
*** 1255,1267 ****
  
       Simplify the base, and then each of the dimensions from left to
       right.  */
!   simplify_expr_common (p, pre_p, post_p, is_simple_min_lval, stmt,
! 			code == COMPONENT_REF ? 3 : 2);
  
    for (; VARRAY_ACTIVE_SIZE (dim_stack) > 0; VARRAY_POP (dim_stack))
      {
        tree *dim_p = (tree *)VARRAY_TOP_GENERIC_PTR (dim_stack);
!       simplify_expr (dim_p, pre_p, post_p, is_simple_val, stmt);
      }
  }
  
--- 1223,1235 ----
  
       Simplify the base, and then each of the dimensions from left to
       right.  */
!   simplify_expr (p, pre_p, post_p, is_simple_min_lval, stmt,
! 		 code == COMPONENT_REF ? fb_either : fb_lvalue);
  
    for (; VARRAY_ACTIVE_SIZE (dim_stack) > 0; VARRAY_POP (dim_stack))
      {
        tree *dim_p = (tree *)VARRAY_TOP_GENERIC_PTR (dim_stack);
!       simplify_expr (dim_p, pre_p, post_p, is_simple_val, stmt, fb_rvalue);
      }
  }
  
*************** simplify_self_mod_expr (expr_p, pre_p, p
*** 1297,1311 ****
  
    /* Simplify the LHS into a SIMPLE lvalue.  */
    lvalue = TREE_OPERAND (*expr_p, 0);
!   simplify_lvalue_expr (&lvalue, pre_p, post_p, is_simple_modify_expr_lhs,
! 			stmt);
  
    /* Extract the operands to the arithmetic operation, including an rvalue
       version of our LHS.  */
    lhs = lvalue;
!   simplify_expr (&lhs, pre_p, post_p, is_simple_id, stmt);
    rhs = TREE_OPERAND (*expr_p, 1);
!   simplify_expr (&rhs, pre_p, post_p, is_simple_val, stmt);
  
    /* Determine whether we need to create a PLUS or a MINUS operation.  */
    if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
--- 1265,1279 ----
  
    /* Simplify the LHS into a SIMPLE lvalue.  */
    lvalue = TREE_OPERAND (*expr_p, 0);
!   simplify_expr (&lvalue, pre_p, post_p, is_simple_modify_expr_lhs,
! 		 stmt, fb_lvalue);
  
    /* Extract the operands to the arithmetic operation, including an rvalue
       version of our LHS.  */
    lhs = lvalue;
!   simplify_expr (&lhs, pre_p, post_p, is_simple_id, stmt, fb_rvalue);
    rhs = TREE_OPERAND (*expr_p, 1);
!   simplify_expr (&rhs, pre_p, post_p, is_simple_val, stmt, fb_rvalue);
  
    /* Determine whether we need to create a PLUS or a MINUS operation.  */
    if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
*************** simplify_component_ref (expr_p, pre_p, p
*** 1363,1369 ****
        abort ();
  
    /* Now we're down to the first bit that isn't a COMPONENT_REF.  */
!   simplify_expr_either (p, pre_p, post_p, is_simple_min_lval, stmt);
  #endif
  }
  
--- 1331,1337 ----
        abort ();
  
    /* Now we're down to the first bit that isn't a COMPONENT_REF.  */
!   simplify_expr (p, pre_p, post_p, is_simple_min_lval, stmt, fb_either);
  #endif
  }
  
*************** simplify_call_expr (expr_p, pre_p, post_
*** 1400,1408 ****
      return;
  
    simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, is_simple_id,
!                  stmt);
    simplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p, is_simple_arglist,
!                  stmt);
  }
  
  
--- 1368,1376 ----
      return;
  
    simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, is_simple_id,
!                  stmt, fb_rvalue);
    simplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p, is_simple_arglist,
!                  stmt, fb_rvalue);
  }
  
  
*************** simplify_tree_list (expr_p, pre_p, post_
*** 1431,1437 ****
      abort ();
  
    for (op = *expr_p; op; op = TREE_CHAIN (op))
!     simplify_expr (&TREE_VALUE (op), pre_p, post_p, is_simple_val, stmt);
  }
  
  
--- 1399,1406 ----
      abort ();
  
    for (op = *expr_p; op; op = TREE_CHAIN (op))
!     simplify_expr (&TREE_VALUE (op), pre_p, post_p, is_simple_val,
! 		   stmt, fb_rvalue);
  }
  
  
*************** simplify_modify_expr (expr_p, pre_p, pos
*** 1527,1536 ****
    if (TREE_CODE (*expr_p) != MODIFY_EXPR)
      abort ();
  
!   simplify_lvalue_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 			is_simple_modify_expr_lhs, stmt);
    simplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p, is_simple_rhs,
!                  stmt);
  
    add_tree (*expr_p, pre_p);
    *expr_p = TREE_OPERAND (*expr_p, 0);
--- 1496,1505 ----
    if (TREE_CODE (*expr_p) != MODIFY_EXPR)
      abort ();
  
!   simplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 		 is_simple_modify_expr_lhs, stmt, fb_lvalue);
    simplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p, is_simple_rhs,
!                  stmt, fb_rvalue);
  
    add_tree (*expr_p, pre_p);
    *expr_p = TREE_OPERAND (*expr_p, 0);
*************** simplify_boolean_expr (expr_p, pre_p, st
*** 1616,1622 ****
    if (TREE_TYPE (t) != TREE_TYPE (*expr_p))
      {
        t = convert (TREE_TYPE (*expr_p), t);
!       simplify_expr (&t, pre_p, NULL, is_simple_id, stmt);
      }
  
    /* Re-write the original expression to use T.  */
--- 1585,1591 ----
    if (TREE_TYPE (t) != TREE_TYPE (*expr_p))
      {
        t = convert (TREE_TYPE (*expr_p), t);
!       simplify_expr (&t, pre_p, NULL, is_simple_id, stmt, fb_rvalue);
      }
  
    /* Re-write the original expression to use T.  */
*************** simplify_compound_expr (expr_p, pre_p, p
*** 1692,1698 ****
    for (i = 0; i < num; i++)
      {
        simplify_expr (&expr_s[i], &pre_expr_s[i], &post_expr_s[i],
! 	             is_simple_expr, stmt);
  
        /* Add the side-effects and the simplified expression to PRE_P.  
  	 This is necessary because the comma operator represents a sequence
--- 1661,1667 ----
    for (i = 0; i < num; i++)
      {
        simplify_expr (&expr_s[i], &pre_expr_s[i], &post_expr_s[i],
! 	             is_simple_expr, stmt, fb_rvalue);
  
        /* Add the side-effects and the simplified expression to PRE_P.  
  	 This is necessary because the comma operator represents a sequence
*************** simplify_expr_wfl (expr_p, pre_p, post_p
*** 1754,1760 ****
    if (TREE_CODE (*expr_p) != EXPR_WITH_FILE_LOCATION)
      abort ();
  
!   simplify_expr (&EXPR_WFL_NODE (*expr_p), pre_p, post_p, simple_test_f, stmt);
  
    file = EXPR_WFL_FILENAME (*expr_p);
    line = EXPR_WFL_LINENO (*expr_p);
--- 1723,1730 ----
    if (TREE_CODE (*expr_p) != EXPR_WITH_FILE_LOCATION)
      abort ();
  
!   simplify_expr (&EXPR_WFL_NODE (*expr_p), pre_p, post_p, simple_test_f,
! 		 stmt, fb_rvalue);
  
    file = EXPR_WFL_FILENAME (*expr_p);
    line = EXPR_WFL_LINENO (*expr_p);
*************** get_initialized_tmp_var (val, pre_p, stm
*** 2022,2028 ****
  {
    tree t, mod;
  
!   simplify_expr (&val, pre_p, NULL, is_simple_rhs, stmt);
    t = create_tmp_var (TREE_TYPE (val));
    mod = build_modify_expr (t, NOP_EXPR, val);
    add_tree (mod, pre_p);
--- 1992,1998 ----
  {
    tree t, mod;
  
!   simplify_expr (&val, pre_p, NULL, is_simple_rhs, stmt, fb_rvalue);
    t = create_tmp_var (TREE_TYPE (val));
    mod = build_modify_expr (t, NOP_EXPR, val);
    add_tree (mod, pre_p);

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