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]

Various reworkings of PLACEHOLDER stuff


At this point, this is in the category of "optimization".  This change
does a few things:

(1) It adds a function type_contains_placeholder_p which returns TRUE
if a type has any attribute (size, position, bound, etc) that depends
on a PLACEHOLDER_EXPR.

(2) It uses that function to restrict optimizations of the few COMPONENT_REFs
that are unsafe and therefore allows Ada to pass them to fold.

(3) It adds a macro CONTAINS_PLACEHOLDER_P to do some checks before calling
the function of similar name (for efficiency) and changes all uses of the
function to use the macro.

This affects Ada only and was tested on i686-pc-linux-gnu.

Mon May 19 16:03:53 2003  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* tree.h (contains_placeholder_p): Now returns bool.
	(CONTAINS_PLACEHOLDER_P): New macro.
	(type_contains_placeholder_p): New function.
	* tree.c (save_expr): Remove code avoiding folding COMPONENT_REF.
	(contains_placeholder_p): Now returns bool.
	Rework to use CONTAINS_PLACEHOLDER_P macro.
	(type_contains_placeholder_p): New function.
	* fold-const.c (fold, case COMPONENT_REF): Don't fold if
	type_contains_placeholder_p.
	(fold_range_test, fold_mathfn_compare, fold_inf_compare, fold): 
	Use CONTAINS_PLACEHOLDER_P macro.
	* builtins.c (fold_builtin): Likewise.
	* calls.c (initialize_argument_information): Likewise.
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
	* explow.c (expr_size): Likewise.
	* expr.c (store_constructor, get_inner_reference): Likewise.
	* function.c (assign_parms): Likewise.
	* stor-layout.c (variable_size): Likewise.

*** gcc/builtins.c	24 May 2003 14:50:02 -0000	1.204
--- gcc/builtins.c	27 May 2003 18:26:59 -0000
*************** fold_builtin (exp)
*** 5243,5247 ****
  	      if (REAL_VALUES_EQUAL (c, dconst2)
  		  && (*lang_hooks.decls.global_bindings_p) () == 0
! 		  && ! contains_placeholder_p (arg0))
  		{
  		  arg0 = save_expr (arg0);
--- 5243,5247 ----
  	      if (REAL_VALUES_EQUAL (c, dconst2)
  		  && (*lang_hooks.decls.global_bindings_p) () == 0
! 		  && ! CONTAINS_PLACEHOLDER_P (arg0))
  		{
  		  arg0 = save_expr (arg0);
*************** fold_builtin (exp)
*** 5253,5257 ****
  		  && REAL_VALUES_EQUAL (c, dconstm2)
  		  && (*lang_hooks.decls.global_bindings_p) () == 0
! 		  && ! contains_placeholder_p (arg0))
  		{
  		  arg0 = save_expr (arg0);
--- 5253,5257 ----
  		  && REAL_VALUES_EQUAL (c, dconstm2)
  		  && (*lang_hooks.decls.global_bindings_p) () == 0
! 		  && ! CONTAINS_PLACEHOLDER_P (arg0))
  		{
  		  arg0 = save_expr (arg0);
*** gcc/calls.c	22 May 2003 20:54:43 -0000	1.275
--- gcc/calls.c	27 May 2003 18:27:01 -0000
*************** initialize_argument_information (num_act
*** 1147,1152 ****
  
        /* See if this argument should be passed by invisible reference.  */
!       if ((TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST
! 	   && contains_placeholder_p (TYPE_SIZE (type)))
  	  || TREE_ADDRESSABLE (type)
  #ifdef FUNCTION_ARG_PASS_BY_REFERENCE
--- 1147,1151 ----
  
        /* See if this argument should be passed by invisible reference.  */
!       if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (type))
  	  || TREE_ADDRESSABLE (type)
  #ifdef FUNCTION_ARG_PASS_BY_REFERENCE
*** gcc/emit-rtl.c	17 May 2003 22:21:30 -0000	1.325
--- gcc/emit-rtl.c	27 May 2003 18:27:06 -0000
*************** set_mem_attributes_minus_bitpos (ref, t,
*** 1987,1995 ****
  		 WITH_RECORD_EXPR; if the component size is, pass our
  		 component to one.  */
! 	      if (! TREE_CONSTANT (index)
! 		  && contains_placeholder_p (index))
  		index = build (WITH_RECORD_EXPR, TREE_TYPE (index), index, t);
! 	      if (! TREE_CONSTANT (unit_size)
! 		  && contains_placeholder_p (unit_size))
  		unit_size = build (WITH_RECORD_EXPR, sizetype,
  				   unit_size, array);
--- 1987,1993 ----
  		 WITH_RECORD_EXPR; if the component size is, pass our
  		 component to one.  */
! 	      if (CONTAINS_PLACEHOLDER_P (index))
  		index = build (WITH_RECORD_EXPR, TREE_TYPE (index), index, t);
! 	      if (CONTAINS_PLACEHOLDER_P (unit_size))
  		unit_size = build (WITH_RECORD_EXPR, sizetype,
  				   unit_size, array);
*** gcc/explow.c	23 May 2003 18:19:19 -0000	1.111
--- gcc/explow.c	27 May 2003 18:27:07 -0000
*************** expr_size (exp)
*** 295,300 ****
    tree size = (*lang_hooks.expr_size) (exp);
  
!   if (TREE_CODE (size) != INTEGER_CST
!       && contains_placeholder_p (size))
      size = build (WITH_RECORD_EXPR, sizetype, size, exp);
  
--- 295,299 ----
    tree size = (*lang_hooks.expr_size) (exp);
  
!   if (CONTAINS_PLACEHOLDER_P (size))
      size = build (WITH_RECORD_EXPR, sizetype, size, exp);
  
*** gcc/expr.c	23 May 2003 00:38:32 -0000	1.542
--- gcc/expr.c	27 May 2003 18:27:11 -0000
*************** store_constructor (exp, target, cleared,
*** 4983,4987 ****
  	      rtx offset_rtx;
  
! 	      if (contains_placeholder_p (offset))
  		offset = build (WITH_RECORD_EXPR, sizetype,
  				offset, make_tree (TREE_TYPE (exp), target));
--- 4983,4987 ----
  	      rtx offset_rtx;
  
! 	      if (CONTAINS_PLACEHOLDER_P (offset))
  		offset = build (WITH_RECORD_EXPR, sizetype,
  				offset, make_tree (TREE_TYPE (exp), target));
*************** get_inner_reference (exp, pbitsize, pbit
*** 5800,5804 ****
  	  if (this_offset == 0)
  	    break;
! 	  else if (contains_placeholder_p (this_offset))
  	    this_offset = build (WITH_RECORD_EXPR, sizetype, this_offset, exp);
  
--- 5800,5804 ----
  	  if (this_offset == 0)
  	    break;
! 	  else if (CONTAINS_PLACEHOLDER_P (this_offset))
  	    this_offset = build (WITH_RECORD_EXPR, sizetype, this_offset, exp);
  
*************** get_inner_reference (exp, pbitsize, pbit
*** 5830,5836 ****
  	     WITH_RECORD_EXPR; if the component size is, pass our
  	     component to one.  */
! 	  if (contains_placeholder_p (index))
  	    index = build (WITH_RECORD_EXPR, TREE_TYPE (index), index, exp);
! 	  if (contains_placeholder_p (unit_size))
  	    unit_size = build (WITH_RECORD_EXPR, sizetype, unit_size, array);
  
--- 5830,5836 ----
  	     WITH_RECORD_EXPR; if the component size is, pass our
  	     component to one.  */
! 	  if (CONTAINS_PLACEHOLDER_P (index))
  	    index = build (WITH_RECORD_EXPR, TREE_TYPE (index), index, exp);
! 	  if (CONTAINS_PLACEHOLDER_P (unit_size))
  	    unit_size = build (WITH_RECORD_EXPR, sizetype, unit_size, array);
  
*** gcc/fold-const.c	23 May 2003 03:46:52 -0000	1.252
--- gcc/fold-const.c	27 May 2003 18:27:14 -0000
*************** fold_range_test (exp)
*** 3471,3475 ****
  
        else if ((*lang_hooks.decls.global_bindings_p) () == 0
! 	       && ! contains_placeholder_p (lhs))
  	{
  	  tree common = save_expr (lhs);
--- 3471,3475 ----
  
        else if ((*lang_hooks.decls.global_bindings_p) () == 0
! 	       && ! CONTAINS_PLACEHOLDER_P (lhs))
  	{
  	  tree common = save_expr (lhs);
*************** fold_mathfn_compare (fcode, code, type, 
*** 4769,4773 ****
  	      /* sqrt(x) < y is x >= 0 && x != +Inf, when y is large.  */
  	      if ((*lang_hooks.decls.global_bindings_p) () != 0
! 		  || contains_placeholder_p (arg))
  		return NULL_TREE;
  
--- 4769,4773 ----
  	      /* sqrt(x) < y is x >= 0 && x != +Inf, when y is large.  */
  	      if ((*lang_hooks.decls.global_bindings_p) () != 0
! 		  || CONTAINS_PLACEHOLDER_P (arg))
  		return NULL_TREE;
  
*************** fold_mathfn_compare (fcode, code, type, 
*** 4789,4793 ****
  	  /* sqrt(x) < c is the same as x >= 0 && x < c*c.  */
  	  if ((*lang_hooks.decls.global_bindings_p) () == 0
! 	      && ! contains_placeholder_p (arg))
  	    {
  	      arg = save_expr (arg);
--- 4789,4793 ----
  	  /* sqrt(x) < c is the same as x >= 0 && x < c*c.  */
  	  if ((*lang_hooks.decls.global_bindings_p) () == 0
! 	      && ! CONTAINS_PLACEHOLDER_P (arg))
  	    {
  	      arg = save_expr (arg);
*************** fold_inf_compare (code, type, arg0, arg1
*** 4852,4856 ****
        /* x <= +Inf is the same as x == x, i.e. isfinite(x).  */
        if ((*lang_hooks.decls.global_bindings_p) () == 0
! 	  && ! contains_placeholder_p (arg0))
  	{
  	  arg0 = save_expr (arg0);
--- 4852,4856 ----
        /* x <= +Inf is the same as x == x, i.e. isfinite(x).  */
        if ((*lang_hooks.decls.global_bindings_p) () == 0
! 	  && ! CONTAINS_PLACEHOLDER_P (arg0))
  	{
  	  arg0 = save_expr (arg0);
*************** fold (expr)
*** 5120,5124 ****
  	       && (! TREE_SIDE_EFFECTS (arg0)
  		   || ((*lang_hooks.decls.global_bindings_p) () == 0
! 		       && ! contains_placeholder_p (arg0))))
  	return
  	  fold_binary_op_with_conditional_arg (code, type, arg1, arg0,
--- 5120,5124 ----
  	       && (! TREE_SIDE_EFFECTS (arg0)
  		   || ((*lang_hooks.decls.global_bindings_p) () == 0
! 		       && ! CONTAINS_PLACEHOLDER_P (arg0))))
  	return
  	  fold_binary_op_with_conditional_arg (code, type, arg1, arg0,
*************** fold (expr)
*** 5134,5138 ****
  	       && (! TREE_SIDE_EFFECTS (arg1)
  		   || ((*lang_hooks.decls.global_bindings_p) () == 0
! 		       && ! contains_placeholder_p (arg1))))
  	return
  	  fold_binary_op_with_conditional_arg (code, type, arg0, arg1,
--- 5134,5138 ----
  	       && (! TREE_SIDE_EFFECTS (arg1)
  		   || ((*lang_hooks.decls.global_bindings_p) () == 0
! 		       && ! CONTAINS_PLACEHOLDER_P (arg1))))
  	return
  	  fold_binary_op_with_conditional_arg (code, type, arg0, arg1,
*************** fold (expr)
*** 5314,5318 ****
  
      case COMPONENT_REF:
!       if (TREE_CODE (arg0) == CONSTRUCTOR)
  	{
  	  tree m = purpose_member (arg1, CONSTRUCTOR_ELTS (arg0));
--- 5314,5319 ----
  
      case COMPONENT_REF:
!       if (TREE_CODE (arg0) == CONSTRUCTOR
! 	  && ! type_contains_placeholder_p (TREE_TYPE (arg0)))
  	{
  	  tree m = purpose_member (arg1, CONSTRUCTOR_ELTS (arg0));
*************** fold (expr)
*** 5884,5888 ****
  	  if (! wins && real_twop (arg1)
  	      && (*lang_hooks.decls.global_bindings_p) () == 0
! 	      && ! contains_placeholder_p (arg0))
  	    {
  	      tree arg = save_expr (arg0);
--- 5885,5889 ----
  	  if (! wins && real_twop (arg1)
  	      && (*lang_hooks.decls.global_bindings_p) () == 0
! 	      && ! CONTAINS_PLACEHOLDER_P (arg0))
  	    {
  	      tree arg = save_expr (arg0);
*** gcc/function.c	17 May 2003 06:52:35 -0000	1.428
--- gcc/function.c	27 May 2003 18:27:18 -0000
*************** assign_parms (fndecl)
*** 4495,4500 ****
  	 that way.  */
  
!       if ((TREE_CODE (TYPE_SIZE (passed_type)) != INTEGER_CST
! 	   && contains_placeholder_p (TYPE_SIZE (passed_type)))
  	  || TREE_ADDRESSABLE (passed_type)
  #ifdef FUNCTION_ARG_PASS_BY_REFERENCE
--- 4495,4499 ----
  	 that way.  */
  
!       if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (passed_type))
  	  || TREE_ADDRESSABLE (passed_type)
  #ifdef FUNCTION_ARG_PASS_BY_REFERENCE
*** gcc/stor-layout.c	4 May 2003 22:04:51 -0000	1.156
--- gcc/stor-layout.c	27 May 2003 18:27:20 -0000
*************** variable_size (size)
*** 163,167 ****
    if (TREE_CONSTANT (size)
        || (*lang_hooks.decls.global_bindings_p) () < 0
!       || contains_placeholder_p (size))
      return size;
  
--- 163,167 ----
    if (TREE_CONSTANT (size)
        || (*lang_hooks.decls.global_bindings_p) () < 0
!       || CONTAINS_PLACEHOLDER_P (size))
      return size;
  
*** gcc/tree.c	20 May 2003 20:24:07 -0000	1.306
--- gcc/tree.c	27 May 2003 18:27:21 -0000
*************** save_expr (expr)
*** 1391,1403 ****
       tree expr;
  {
!   tree t = expr;
    tree inner;
  
-   /* Don't fold a COMPONENT_EXPR: if the operand was a CONSTRUCTOR (the
-      only time it will fold), it can cause problems with PLACEHOLDER_EXPRs
-      in Ada.  Moreover, it isn't at all clear why we fold here at all.  */
-   if (TREE_CODE (t) != COMPONENT_REF)
-     t = fold (t);
- 
    /* If the tree evaluates to a constant, then we don't want to hide that
       fact (i.e. this allows further folding, and direct checks for constants).
--- 1391,1397 ----
       tree expr;
  {
!   tree t = fold (expr);
    tree inner;
  
    /* If the tree evaluates to a constant, then we don't want to hide that
       fact (i.e. this allows further folding, and direct checks for constants).
*************** unsafe_for_reeval (expr)
*** 1746,1750 ****
     or offset that depends on a field within a record.  */
  
! int
  contains_placeholder_p (exp)
       tree exp;
--- 1740,1744 ----
     or offset that depends on a field within a record.  */
  
! bool
  contains_placeholder_p (exp)
       tree exp;
*************** contains_placeholder_p (exp)
*** 1771,1781 ****
  	 WITH_RECORD_EXPR involving the reference, which will assume
  	 here will be valid.  */
!       return contains_placeholder_p (TREE_OPERAND (exp, 0));
  
      case 'x':
        if (code == TREE_LIST)
! 	return (contains_placeholder_p (TREE_VALUE (exp))
! 		|| (TREE_CHAIN (exp) != 0
! 		    && contains_placeholder_p (TREE_CHAIN (exp))));
        break;
  
--- 1765,1774 ----
  	 WITH_RECORD_EXPR involving the reference, which will assume
  	 here will be valid.  */
!       return CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0));
  
      case 'x':
        if (code == TREE_LIST)
! 	return (CONTAINS_PLACEHOLDER_P (TREE_VALUE (exp))
! 		|| CONTAINS_PLACEHOLDER_P (TREE_CHAIN (exp)));
        break;
  
*************** contains_placeholder_p (exp)
*** 1787,1791 ****
  	case COMPOUND_EXPR:
  	  /* Ignoring the first operand isn't quite right, but works best.  */
! 	  return contains_placeholder_p (TREE_OPERAND (exp, 1));
  
  	case RTL_EXPR:
--- 1780,1784 ----
  	case COMPOUND_EXPR:
  	  /* Ignoring the first operand isn't quite right, but works best.  */
! 	  return CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 1));
  
  	case RTL_EXPR:
*************** contains_placeholder_p (exp)
*** 1794,1800 ****
  
  	case COND_EXPR:
! 	  return (contains_placeholder_p (TREE_OPERAND (exp, 0))
! 		  || contains_placeholder_p (TREE_OPERAND (exp, 1))
! 		  || contains_placeholder_p (TREE_OPERAND (exp, 2)));
  
  	case SAVE_EXPR:
--- 1787,1793 ----
  
  	case COND_EXPR:
! 	  return (CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0))
! 		  || CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 1))
! 		  || CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 2)));
  
  	case SAVE_EXPR:
*************** contains_placeholder_p (exp)
*** 1805,1809 ****
  
  	  SAVE_EXPR_NOPLACEHOLDER (exp) = 1;
! 	  result = contains_placeholder_p (TREE_OPERAND (exp, 0));
  	  if (result)
  	    SAVE_EXPR_NOPLACEHOLDER (exp) = 0;
--- 1798,1802 ----
  
  	  SAVE_EXPR_NOPLACEHOLDER (exp) = 1;
! 	  result = CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0));
  	  if (result)
  	    SAVE_EXPR_NOPLACEHOLDER (exp) = 0;
*************** contains_placeholder_p (exp)
*** 1812,1817 ****
  
  	case CALL_EXPR:
! 	  return (TREE_OPERAND (exp, 1) != 0
! 		  && contains_placeholder_p (TREE_OPERAND (exp, 1)));
  
  	default:
--- 1805,1809 ----
  
  	case CALL_EXPR:
! 	  return CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 1));
  
  	default:
*************** contains_placeholder_p (exp)
*** 1822,1829 ****
  	{
  	case 1:
! 	  return contains_placeholder_p (TREE_OPERAND (exp, 0));
  	case 2:
! 	  return (contains_placeholder_p (TREE_OPERAND (exp, 0))
! 		  || contains_placeholder_p (TREE_OPERAND (exp, 1)));
  	default:
  	  return 0;
--- 1814,1821 ----
  	{
  	case 1:
! 	  return CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0));
  	case 2:
! 	  return (CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0))
! 		  || CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 1)));
  	default:
  	  return 0;
*************** contains_placeholder_p (exp)
*** 1836,1839 ****
--- 1828,1934 ----
  }
  
+ /* Return 1 if any part of the computation of TYPE involves a PLACEHOLDER_EXPR.
+    This includes size, bounds, qualifiers (for QUAL_UNION_TYPE) and field
+    positions.  */
+ 
+ bool
+ type_contains_placeholder_p (type)
+      tree type;
+ {
+   /* If the size contains a placeholder or the parent type (component type in
+      the case of arrays) type involves a placeholder, this type does.  */
+   if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (type))
+       || CONTAINS_PLACEHOLDER_P (TYPE_SIZE_UNIT (type))
+       || (TREE_TYPE (type) != 0
+ 	  && type_contains_placeholder_p (TREE_TYPE (type))))
+     return 1;
+ 
+   /* Now do type-specific checks.  Note that the last part of the check above
+      greatly limits what we have to do below.  */
+   switch (TREE_CODE (type))
+     {
+     case VOID_TYPE:
+     case COMPLEX_TYPE:
+     case VECTOR_TYPE:
+     case ENUMERAL_TYPE:
+     case BOOLEAN_TYPE:
+     case CHAR_TYPE:
+     case POINTER_TYPE:
+     case OFFSET_TYPE:
+     case REFERENCE_TYPE:
+     case METHOD_TYPE:
+     case FILE_TYPE:
+     case FUNCTION_TYPE:
+       return 0;
+ 
+     case INTEGER_TYPE:
+     case REAL_TYPE:
+       /* Here we just check the bounds.  */
+       return (CONTAINS_PLACEHOLDER_P (TYPE_MIN_VALUE (type))
+ 	      || CONTAINS_PLACEHOLDER_P (TYPE_MAX_VALUE (type)));
+ 
+     case ARRAY_TYPE:
+     case SET_TYPE:
+       /* We're already checked the component type (TREE_TYPE), so just check
+ 	 the index type.  */
+       return type_contains_placeholder_p (TYPE_DOMAIN (type));
+ 
+     case RECORD_TYPE:
+     case UNION_TYPE:
+     case QUAL_UNION_TYPE:
+       {
+ 	static tree seen_types = 0;
+ 	tree field;
+ 	bool ret = 0;
+ 
+ 	/* We have to be careful here that we don't end up in infinite
+ 	   recursions due to a field of a type being a pointer to that type
+ 	   or to a mutually-recursive type.  So we store a list of record
+ 	   types that we've seen and see if this type is in them.  To save
+ 	   memory, we don't use a list for just one type.  Here we check
+ 	   whether we've seen this type before and store it if not.  */
+ 	if (seen_types == 0)
+ 	  seen_types = type;
+ 	else if (TREE_CODE (seen_types) != TREE_LIST)
+ 	  {
+ 	    if (seen_types == type)
+ 	      return 0;
+ 
+ 	    seen_types = tree_cons (NULL_TREE, type,
+ 				    build_tree_list (NULL_TREE, seen_types));
+ 	  }
+ 	else
+ 	  {
+ 	    if (value_member (type, seen_types) != 0)
+ 	      return 0;
+ 
+ 	    seen_types = tree_cons (NULL_TREE, type, seen_types);
+ 	  }
+ 
+ 	for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ 	  if (TREE_CODE (field) == FIELD_DECL
+ 	      && (CONTAINS_PLACEHOLDER_P (DECL_FIELD_OFFSET (field))
+ 		  || (TREE_CODE (type) == QUAL_UNION_TYPE
+ 		      && CONTAINS_PLACEHOLDER_P (DECL_QUALIFIER (field)))
+ 		  || type_contains_placeholder_p (TREE_TYPE (field))))
+ 	    {
+ 	      ret = true;
+ 	      break;
+ 	    }
+ 
+ 	/* Now remove us from seen_types and return the result.  */
+ 	if (seen_types == type)
+ 	  seen_types = 0;
+ 	else
+ 	  seen_types = TREE_CHAIN (seen_types);
+ 
+ 	return ret;
+       }
+ 
+     default:
+       abort ();
+     }
+ }
+ 
  /* Return 1 if EXP contains any expressions that produce cleanups for an
     outer scope to deal with.  Used by fold.  */
*************** substitute_in_expr (exp, f, r)
*** 1961,1967 ****
  	  op0 = TREE_OPERAND (exp, 0);
  	  op1 = TREE_OPERAND (exp, 1);
! 	  if (contains_placeholder_p (op0))
  	    op0 = substitute_in_expr (op0, f, r);
! 	  if (contains_placeholder_p (op1))
  	    op1 = substitute_in_expr (op1, f, r);
  
--- 2056,2062 ----
  	  op0 = TREE_OPERAND (exp, 0);
  	  op1 = TREE_OPERAND (exp, 1);
! 	  if (CONTAINS_PLACEHOLDER_P (op0))
  	    op0 = substitute_in_expr (op0, f, r);
! 	  if (CONTAINS_PLACEHOLDER_P (op1))
  	    op1 = substitute_in_expr (op1, f, r);
  
*************** substitute_in_expr (exp, f, r)
*** 1995,2003 ****
  	  op2 = TREE_OPERAND (exp, 2);
  
! 	  if (contains_placeholder_p (op0))
  	    op0 = substitute_in_expr (op0, f, r);
! 	  if (contains_placeholder_p (op1))
  	    op1 = substitute_in_expr (op1, f, r);
! 	  if (contains_placeholder_p (op2))
  	    op2 = substitute_in_expr (op2, f, r);
  
--- 2090,2098 ----
  	  op2 = TREE_OPERAND (exp, 2);
  
! 	  if (CONTAINS_PLACEHOLDER_P (op0))
  	    op0 = substitute_in_expr (op0, f, r);
! 	  if (CONTAINS_PLACEHOLDER_P (op1))
  	    op1 = substitute_in_expr (op1, f, r);
! 	  if (CONTAINS_PLACEHOLDER_P (op2))
  	    op2 = substitute_in_expr (op2, f, r);
  
*** gcc/tree.h	21 May 2003 11:13:19 -0000	1.404
--- gcc/tree.h	27 May 2003 18:27:24 -0000
*************** extern int unsafe_for_reeval		PARAMS ((t
*** 2524,2528 ****
     or a COND_EXPR.  */
  
! extern int contains_placeholder_p	PARAMS ((tree));
  
  /* Return 1 if EXP contains any expressions that produce cleanups for an
--- 2524,2540 ----
     or a COND_EXPR.  */
  
! extern bool contains_placeholder_p	PARAMS ((tree));
! 
! /* This macro calls the above function but short-circuits the common
!    case of a constant to save time.  Also check for null.  */
! 
! #define CONTAINS_PLACEHOLDER_P(EXP) \
!   ((EXP) != 0 && ! TREE_CONSTANT (EXP) && contains_placeholder_p (EXP))
! 
! /* Return 1 if any part of the computation of TYPE involves a PLACEHOLDER_EXPR.
!    This includes size, bounds, qualifiers (for QUAL_UNION_TYPE) and field
!    positions.  */
! 
! extern bool type_contains_placeholder_p	PARAMS ((tree));
  
  /* Return 1 if EXP contains any expressions that produce cleanups for an


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