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]

[PATCH] Transition C front-end from build to buildN


The following patch replaces all occurences of build with the now
preferred buildN throughout the C front-end.  There should be no
functional changes.

The following patch has been tested on i686-pc-linux-gnu with a full
"make bootstrap", all default languages, and regression tested with
a top-level "make -k check" with no new failures.

Ok for mainline?


2004-08-14  Roger Sayle  <roger@eyesopen.com>

	* c-common.c (shorten_compare, pointer_int_sum,
	c_common_truthvalue_conversion, boolean_increment): Replace calls
	to build with calls to buildN.
	* c-decl.c (complete_array_type, grokdeclarator): Likewise.
	* c-gimplify.c (c_build_bind_expr, gimplify_c_loop,
	gimplify_switch_stmt): Likewise.
	* c-typeck.c (default_function_array_conversion,
	build_component_ref, build_array_ref, build_function_call,
	pointer_diff, build_unary_op, build_conditional_expr,
	build_compound_expr, build_modify_expr, c_finish_goto_label,
	c_finish_goto_ptr, c_finish_return, c_finish_loop,
	c_finish_bc_stmt, c_finish_stmt_expr, c_end_compound_stmt,
	build_binary_op): Likewise.


Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.549
diff -c -3 -p -r1.549 c-common.c
*** c-common.c	7 Aug 2004 16:11:09 -0000	1.549
--- c-common.c	14 Aug 2004 20:00:11 -0000
*************** shorten_compare (tree *op0_ptr, tree *op
*** 2110,2116 ****
  	{
  	  /* Don't forget to evaluate PRIMOP0 if it has side effects.  */
  	  if (TREE_SIDE_EFFECTS (primop0))
! 	    return build (COMPOUND_EXPR, TREE_TYPE (val), primop0, val);
  	  return val;
  	}

--- 2110,2116 ----
  	{
  	  /* Don't forget to evaluate PRIMOP0 if it has side effects.  */
  	  if (TREE_SIDE_EFFECTS (primop0))
! 	    return build2 (COMPOUND_EXPR, TREE_TYPE (val), primop0, val);
  	  return val;
  	}

*************** shorten_compare (tree *op0_ptr, tree *op
*** 2194,2201 ****
  	    {
  	      /* Don't forget to evaluate PRIMOP0 if it has side effects.  */
  	      if (TREE_SIDE_EFFECTS (primop0))
! 		return build (COMPOUND_EXPR, TREE_TYPE (value),
! 			      primop0, value);
  	      return value;
  	    }
  	}
--- 2194,2201 ----
  	    {
  	      /* Don't forget to evaluate PRIMOP0 if it has side effects.  */
  	      if (TREE_SIDE_EFFECTS (primop0))
! 		return build2 (COMPOUND_EXPR, TREE_TYPE (value),
! 			       primop0, value);
  	      return value;
  	    }
  	}
*************** pointer_int_sum (enum tree_code resultco
*** 2290,2296 ****
  				    convert (TREE_TYPE (intop), size_exp), 1));

    /* Create the sum or difference.  */
!   return fold (build (resultcode, result_type, ptrop, intop));
  }

  /* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
--- 2290,2296 ----
  				    convert (TREE_TYPE (intop), size_exp), 1));

    /* Create the sum or difference.  */
!   return fold (build2 (resultcode, result_type, ptrop, intop));
  }

  /* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
*************** c_common_truthvalue_conversion (tree exp
*** 2356,2363 ****
  	  break;

  	if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 0)))
! 	  return build (COMPOUND_EXPR, truthvalue_type_node,
! 			TREE_OPERAND (expr, 0), truthvalue_true_node);
  	else
  	  return truthvalue_true_node;
        }
--- 2356,2363 ----
  	  break;

  	if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 0)))
! 	  return build2 (COMPOUND_EXPR, truthvalue_type_node,
! 			 TREE_OPERAND (expr, 0), truthvalue_true_node);
  	else
  	  return truthvalue_true_node;
        }
*************** c_common_truthvalue_conversion (tree exp
*** 2380,2393 ****
        /* These don't change whether an object is zero or nonzero, but
  	 we can't ignore them if their second arg has side-effects.  */
        if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1)))
! 	return build (COMPOUND_EXPR, truthvalue_type_node, TREE_OPERAND (expr, 1),
! 		      lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0)));
        else
  	return lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0));

      case COND_EXPR:
        /* Distribute the conversion into the arms of a COND_EXPR.  */
!       return fold (build (COND_EXPR, truthvalue_type_node, TREE_OPERAND (expr, 0),
  		lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 1)),
  		lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 2))));

--- 2380,2395 ----
        /* These don't change whether an object is zero or nonzero, but
  	 we can't ignore them if their second arg has side-effects.  */
        if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1)))
! 	return build2 (COMPOUND_EXPR, truthvalue_type_node,
! 		       TREE_OPERAND (expr, 1),
! 		       lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0)));
        else
  	return lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0));

      case COND_EXPR:
        /* Distribute the conversion into the arms of a COND_EXPR.  */
!       return fold (build3 (COND_EXPR, truthvalue_type_node,
! 		TREE_OPERAND (expr, 0),
  		lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 1)),
  		lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 2))));

*************** boolean_increment (enum tree_code code,
*** 3848,3869 ****
    switch (code)
      {
      case PREINCREMENT_EXPR:
!       val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res);
        break;
      case POSTINCREMENT_EXPR:
!       val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res);
        arg = save_expr (arg);
!       val = build (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
!       val = build (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
        break;
      case PREDECREMENT_EXPR:
!       val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, invert_truthvalue (arg));
        break;
      case POSTDECREMENT_EXPR:
!       val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, invert_truthvalue (arg));
        arg = save_expr (arg);
!       val = build (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
!       val = build (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
        break;
      default:
        abort ();
--- 3850,3873 ----
    switch (code)
      {
      case PREINCREMENT_EXPR:
!       val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res);
        break;
      case POSTINCREMENT_EXPR:
!       val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res);
        arg = save_expr (arg);
!       val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
!       val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
        break;
      case PREDECREMENT_EXPR:
!       val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg,
! 		    invert_truthvalue (arg));
        break;
      case POSTDECREMENT_EXPR:
!       val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg,
! 		    invert_truthvalue (arg));
        arg = save_expr (arg);
!       val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
!       val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
        break;
      default:
        abort ();
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.553
diff -c -3 -p -r1.553 c-decl.c
*** c-decl.c	6 Aug 2004 02:03:18 -0000	1.553
--- c-decl.c	14 Aug 2004 20:00:12 -0000
*************** complete_array_type (tree type, tree ini
*** 3264,3271 ****
  	      if (TREE_PURPOSE (elts))
  		maxindex = TREE_PURPOSE (elts);
  	      else
! 		maxindex = fold (build (PLUS_EXPR, integer_type_node,
! 					maxindex, integer_one_node));
  	    }
  	}
        else
--- 3264,3271 ----
  	      if (TREE_PURPOSE (elts))
  		maxindex = TREE_PURPOSE (elts);
  	      else
! 		maxindex = fold (build2 (PLUS_EXPR, integer_type_node,
! 					 maxindex, integer_one_node));
  	    }
  	}
        else
*************** grokdeclarator (tree declarator, tree de
*** 4086,4094 ****
  		     Do the calculation in index_type, so that if it is
  		     a variable the computations will be done in the
  		     proper mode.  */
! 	          itype = fold (build (MINUS_EXPR, index_type,
! 				       convert (index_type, size),
! 				       convert (index_type, size_one_node)));

  	          /* If that overflowed, the array is too big.
  		     ??? While a size of INT_MAX+1 technically shouldn't
--- 4086,4094 ----
  		     Do the calculation in index_type, so that if it is
  		     a variable the computations will be done in the
  		     proper mode.  */
! 	          itype = fold (build2 (MINUS_EXPR, index_type,
! 					convert (index_type, size),
! 					convert (index_type, size_one_node)));

  	          /* If that overflowed, the array is too big.
  		     ??? While a size of INT_MAX+1 technically shouldn't
Index: c-gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-gimplify.c,v
retrieving revision 2.21
diff -c -3 -p -r2.21 c-gimplify.c
*** c-gimplify.c	30 Jun 2004 18:05:03 -0000	2.21
--- c-gimplify.c	14 Aug 2004 20:00:12 -0000
*************** c_build_bind_expr (tree block, tree body
*** 196,202 ****
      body = build_empty_stmt ();
    if (decls || block)
      {
!       bind = build (BIND_EXPR, void_type_node, decls, body, block);
        TREE_SIDE_EFFECTS (bind) = 1;
      }
    else
--- 196,202 ----
      body = build_empty_stmt ();
    if (decls || block)
      {
!       bind = build3 (BIND_EXPR, void_type_node, decls, body, block);
        TREE_SIDE_EFFECTS (bind) = 1;
      }
    else
*************** gimplify_c_loop (tree cond, tree body, t
*** 365,371 ****
        if (cond)
  	{
  	  t = build_bc_goto (bc_break);
! 	  exit = build (COND_EXPR, void_type_node, cond, exit, t);
  	  exit = fold (exit);
  	  gimplify_stmt (&exit);
  	}
--- 365,371 ----
        if (cond)
  	{
  	  t = build_bc_goto (bc_break);
! 	  exit = build3 (COND_EXPR, void_type_node, cond, exit, t);
  	  exit = fold (exit);
  	  gimplify_stmt (&exit);
  	}
*************** gimplify_switch_stmt (tree *stmt_p)
*** 456,463 ****
    if (!body)
      body = build_empty_stmt ();

!   *stmt_p = build (SWITCH_EXPR, SWITCH_TYPE (stmt), SWITCH_COND (stmt),
! 		   body, NULL_TREE);
    SET_EXPR_LOCATION (*stmt_p, stmt_locus);
    gimplify_stmt (stmt_p);

--- 456,463 ----
    if (!body)
      body = build_empty_stmt ();

!   *stmt_p = build3 (SWITCH_EXPR, SWITCH_TYPE (stmt), SWITCH_COND (stmt),
! 		    body, NULL_TREE);
    SET_EXPR_LOCATION (*stmt_p, stmt_locus);
    gimplify_stmt (stmt_p);

Index: c-typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.354
diff -c -3 -p -r1.354 c-typeck.c
*** c-typeck.c	6 Aug 2004 11:23:08 -0000	1.354
--- c-typeck.c	14 Aug 2004 20:00:13 -0000
*************** default_function_array_conversion (tree
*** 1217,1224 ****
        if (TREE_CODE (exp) == COMPOUND_EXPR)
  	{
  	  tree op1 = default_conversion (TREE_OPERAND (exp, 1));
! 	  return build (COMPOUND_EXPR, TREE_TYPE (op1),
! 			TREE_OPERAND (exp, 0), op1);
  	}

        lvalue_array_p = !not_lvalue && lvalue_p (exp);
--- 1217,1224 ----
        if (TREE_CODE (exp) == COMPOUND_EXPR)
  	{
  	  tree op1 = default_conversion (TREE_OPERAND (exp, 1));
! 	  return build2 (COMPOUND_EXPR, TREE_TYPE (op1),
! 			 TREE_OPERAND (exp, 0), op1);
  	}

        lvalue_array_p = !not_lvalue && lvalue_p (exp);
*************** build_component_ref (tree datum, tree co
*** 1456,1463 ****
      case COMPOUND_EXPR:
        {
  	tree value = build_component_ref (TREE_OPERAND (datum, 1), component);
! 	return build (COMPOUND_EXPR, TREE_TYPE (value),
! 		      TREE_OPERAND (datum, 0), non_lvalue (value));
        }
      default:
        break;
--- 1456,1463 ----
      case COMPOUND_EXPR:
        {
  	tree value = build_component_ref (TREE_OPERAND (datum, 1), component);
! 	return build2 (COMPOUND_EXPR, TREE_TYPE (value),
! 		       TREE_OPERAND (datum, 0), non_lvalue (value));
        }
      default:
        break;
*************** build_component_ref (tree datum, tree co
*** 1495,1502 ****
  	  if (TREE_TYPE (subdatum) == error_mark_node)
  	    return error_mark_node;

! 	  ref = build (COMPONENT_REF, TREE_TYPE (subdatum), datum, subdatum,
! 		       NULL_TREE);
  	  if (TREE_READONLY (datum) || TREE_READONLY (subdatum))
  	    TREE_READONLY (ref) = 1;
  	  if (TREE_THIS_VOLATILE (datum) || TREE_THIS_VOLATILE (subdatum))
--- 1495,1502 ----
  	  if (TREE_TYPE (subdatum) == error_mark_node)
  	    return error_mark_node;

! 	  ref = build3 (COMPONENT_REF, TREE_TYPE (subdatum), datum, subdatum,
! 			NULL_TREE);
  	  if (TREE_READONLY (datum) || TREE_READONLY (subdatum))
  	    TREE_READONLY (ref) = 1;
  	  if (TREE_THIS_VOLATILE (datum) || TREE_THIS_VOLATILE (subdatum))
*************** build_array_ref (tree array, tree index)
*** 1649,1655 ****
  	}

        type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (array)));
!       rval = build (ARRAY_REF, type, array, index, NULL_TREE, NULL_TREE);
        /* Array ref is const/volatile if the array elements are
           or if the array is.  */
        TREE_READONLY (rval)
--- 1649,1655 ----
  	}

        type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (array)));
!       rval = build4 (ARRAY_REF, type, array, index, NULL_TREE, NULL_TREE);
        /* Array ref is const/volatile if the array elements are
           or if the array is.  */
        TREE_READONLY (rval)
*************** build_function_call (tree function, tree
*** 1869,1875 ****
  	  else
  	    rhs = fold (build1 (NOP_EXPR, return_type, integer_zero_node));

! 	  return build (COMPOUND_EXPR, return_type, trap, rhs);
  	}
      }

--- 1869,1875 ----
  	  else
  	    rhs = fold (build1 (NOP_EXPR, return_type, integer_zero_node));

! 	  return build2 (COMPOUND_EXPR, return_type, trap, rhs);
  	}
      }

*************** build_function_call (tree function, tree
*** 1883,1890 ****

    check_function_arguments (TYPE_ATTRIBUTES (fntype), coerced_params);

!   result = build (CALL_EXPR, TREE_TYPE (fntype),
! 		  function, coerced_params, NULL_TREE);
    TREE_SIDE_EFFECTS (result) = 1;

    if (require_constant_value)
--- 1883,1890 ----

    check_function_arguments (TYPE_ATTRIBUTES (fntype), coerced_params);

!   result = build3 (CALL_EXPR, TREE_TYPE (fntype),
! 		   function, coerced_params, NULL_TREE);
    TREE_SIDE_EFFECTS (result) = 1;

    if (require_constant_value)
*************** pointer_diff (tree op0, tree op1)
*** 2246,2252 ****
    op1 = c_size_in_bytes (target_type);

    /* Divide by the size, in easiest possible way.  */
!   return fold (build (EXACT_DIV_EXPR, restype, op0, convert (restype, op1)));
  }

  /* Construct and perhaps optimize a tree representation
--- 2246,2252 ----
    op1 = c_size_in_bytes (target_type);

    /* Divide by the size, in easiest possible way.  */
!   return fold (build2 (EXACT_DIV_EXPR, restype, op0, convert (restype, op1)));
  }

  /* Construct and perhaps optimize a tree representation
*************** build_unary_op (enum tree_code code, tre
*** 2395,2402 ****
  	  arg = stabilize_reference (arg);
  	  real = build_unary_op (REALPART_EXPR, arg, 1);
  	  imag = build_unary_op (IMAGPART_EXPR, arg, 1);
! 	  return build (COMPLEX_EXPR, TREE_TYPE (arg),
! 			build_unary_op (code, real, 1), imag);
  	}

        /* Report invalid types.  */
--- 2395,2402 ----
  	  arg = stabilize_reference (arg);
  	  real = build_unary_op (REALPART_EXPR, arg, 1);
  	  imag = build_unary_op (IMAGPART_EXPR, arg, 1);
! 	  return build2 (COMPLEX_EXPR, TREE_TYPE (arg),
! 			 build_unary_op (code, real, 1), imag);
  	}

        /* Report invalid types.  */
*************** build_unary_op (enum tree_code code, tre
*** 2466,2472 ****
  	if (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE)
  	  val = boolean_increment (code, arg);
  	else
! 	  val = build (code, TREE_TYPE (arg), arg, inc);
  	TREE_SIDE_EFFECTS (val) = 1;
  	val = convert (result_type, val);
  	if (TREE_CODE (val) != code)
--- 2466,2472 ----
  	if (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE)
  	  val = boolean_increment (code, arg);
  	else
! 	  val = build2 (code, TREE_TYPE (arg), arg, inc);
  	TREE_SIDE_EFFECTS (val) = 1;
  	val = convert (result_type, val);
  	if (TREE_CODE (val) != code)
*************** build_unary_op (enum tree_code code, tre
*** 2535,2543 ****
  		return error_mark_node;
  	      }

! 	    addr = fold (build (PLUS_EXPR, argtype,
! 				convert (argtype, addr),
! 				convert (argtype, byte_position (field))));
  	  }
  	else
  	  addr = build1 (code, argtype, arg);
--- 2535,2543 ----
  		return error_mark_node;
  	      }

! 	    addr = fold (build2 (PLUS_EXPR, argtype,
! 				 convert (argtype, addr),
! 				 convert (argtype, byte_position (field))));
  	  }
  	else
  	  addr = build1 (code, argtype, arg);
*************** build_conditional_expr (tree ifexp, tree
*** 2867,2873 ****
    if (TREE_CODE (ifexp) == INTEGER_CST)
      return non_lvalue (integer_zerop (ifexp) ? op2 : op1);

!   return fold (build (COND_EXPR, result_type, ifexp, op1, op2));
  }

  /* Return a compound expression that performs two expressions and
--- 2867,2873 ----
    if (TREE_CODE (ifexp) == INTEGER_CST)
      return non_lvalue (integer_zerop (ifexp) ? op2 : op1);

!   return fold (build3 (COND_EXPR, result_type, ifexp, op1, op2));
  }

  /* Return a compound expression that performs two expressions and
*************** build_compound_expr (tree expr1, tree ex
*** 2901,2907 ****
    else if (warn_unused_value)
      warn_if_unused_value (expr1, input_location);

!   return build (COMPOUND_EXPR, TREE_TYPE (expr2), expr1, expr2);
  }

  /* Build an expression representing a cast to type TYPE of expression EXPR.  */
--- 2901,2907 ----
    else if (warn_unused_value)
      warn_if_unused_value (expr1, input_location);

!   return build2 (COMPOUND_EXPR, TREE_TYPE (expr2), expr1, expr2);
  }

  /* Build an expression representing a cast to type TYPE of expression EXPR.  */
*************** build_modify_expr (tree lhs, enum tree_c
*** 3223,3229 ****

    /* Scan operands */

!   result = build (MODIFY_EXPR, lhstype, lhs, newrhs);
    TREE_SIDE_EFFECTS (result) = 1;

    /* If we got the LHS in a different type for storing in,
--- 3223,3229 ----

    /* Scan operands */

!   result = build2 (MODIFY_EXPR, lhstype, lhs, newrhs);
    TREE_SIDE_EFFECTS (result) = 1;

    /* If we got the LHS in a different type for storing in,
*************** c_finish_goto_label (tree label)
*** 6217,6223 ****
      return NULL_TREE;

    TREE_USED (decl) = 1;
!   return add_stmt (build (GOTO_EXPR, void_type_node, decl));
  }

  /* Generate a computed goto statement to EXPR.  */
--- 6217,6223 ----
      return NULL_TREE;

    TREE_USED (decl) = 1;
!   return add_stmt (build1 (GOTO_EXPR, void_type_node, decl));
  }

  /* Generate a computed goto statement to EXPR.  */
*************** c_finish_goto_ptr (tree expr)
*** 6228,6234 ****
    if (pedantic)
      pedwarn ("ISO C forbids `goto *expr;'");
    expr = convert (ptr_type_node, expr);
!   return add_stmt (build (GOTO_EXPR, void_type_node, expr));
  }

  /* Generate a C `return' statement.  RETVAL is the expression for what
--- 6228,6234 ----
    if (pedantic)
      pedwarn ("ISO C forbids `goto *expr;'");
    expr = convert (ptr_type_node, expr);
!   return add_stmt (build1 (GOTO_EXPR, void_type_node, expr));
  }

  /* Generate a C `return' statement.  RETVAL is the expression for what
*************** c_finish_return (tree retval)
*** 6319,6325 ****
  	  break;
  	}

!       retval = build (MODIFY_EXPR, TREE_TYPE (res), res, t);
      }

    return add_stmt (build_stmt (RETURN_EXPR, retval));
--- 6319,6325 ----
  	  break;
  	}

!       retval = build2 (MODIFY_EXPR, TREE_TYPE (res), res, t);
      }

    return add_stmt (build_stmt (RETURN_EXPR, retval));
*************** c_finish_loop (location_t start_locus, t
*** 6554,6560 ****
              }

  	  t = build_and_jump (&blab);
!           exit = build (COND_EXPR, void_type_node, cond, exit, t);
            exit = fold (exit);
  	  if (cond_is_first)
              SET_EXPR_LOCATION (exit, start_locus);
--- 6554,6560 ----
              }

  	  t = build_and_jump (&blab);
!           exit = build3 (COND_EXPR, void_type_node, cond, exit, t);
            exit = fold (exit);
  	  if (cond_is_first)
              SET_EXPR_LOCATION (exit, start_locus);
*************** c_finish_bc_stmt (tree *label_p, bool is
*** 6595,6601 ****
        return NULL_TREE;
      }

!   return add_stmt (build (GOTO_EXPR, void_type_node, label));
  }

  /* A helper routine for c_process_expr_stmt and c_finish_stmt_expr.  */
--- 6595,6601 ----
        return NULL_TREE;
      }

!   return add_stmt (build1 (GOTO_EXPR, void_type_node, label));
  }

  /* A helper routine for c_process_expr_stmt and c_finish_stmt_expr.  */
*************** c_finish_stmt_expr (tree body)
*** 6760,6769 ****
        && TREE_TYPE (val) == TREE_TYPE (TREE_OPERAND (val, 0)))
      val = TREE_OPERAND (val, 0);

!   *last_p = build (MODIFY_EXPR, void_type_node, tmp, val);
    SET_EXPR_LOCUS (*last_p, EXPR_LOCUS (last));

!   return build (TARGET_EXPR, type, tmp, body, NULL_TREE, NULL_TREE);
  }

  /* Begin and end compound statements.  This is as simple as pushing
--- 6760,6769 ----
        && TREE_TYPE (val) == TREE_TYPE (TREE_OPERAND (val, 0)))
      val = TREE_OPERAND (val, 0);

!   *last_p = build2 (MODIFY_EXPR, void_type_node, tmp, val);
    SET_EXPR_LOCUS (*last_p, EXPR_LOCUS (last));

!   return build4 (TARGET_EXPR, type, tmp, body, NULL_TREE, NULL_TREE);
  }

  /* Begin and end compound statements.  This is as simple as pushing
*************** c_end_compound_stmt (tree stmt, bool do_
*** 6802,6808 ****
        && STATEMENT_LIST_STMT_EXPR (cur_stmt_list)
        && TREE_CODE (stmt) != BIND_EXPR)
      {
!       stmt = build (BIND_EXPR, void_type_node, NULL, stmt, NULL);
        TREE_SIDE_EFFECTS (stmt) = 1;
      }

--- 6802,6808 ----
        && STATEMENT_LIST_STMT_EXPR (cur_stmt_list)
        && TREE_CODE (stmt) != BIND_EXPR)
      {
!       stmt = build3 (BIND_EXPR, void_type_node, NULL, stmt, NULL);
        TREE_SIDE_EFFECTS (stmt) = 1;
      }

*************** build_binary_op (enum tree_code code, tr
*** 7553,7559 ****
      build_type = result_type;

    {
!     tree result = build (resultcode, build_type, op0, op1);

      /* Treat expressions in initializers specially as they can't trap.  */
      result = require_constant_value ? fold_initializer (result)
--- 7553,7559 ----
      build_type = result_type;

    {
!     tree result = build2 (resultcode, build_type, op0, op1);

      /* Treat expressions in initializers specially as they can't trap.  */
      result = require_constant_value ? fold_initializer (result)

Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


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