This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][1/N][C][C++][Fortran][Java] Change POINTER_PLUS_EXPR offset type requirements


On Tue, 12 Jul 2011, Richard Guenther wrote:

> 
> This patch is step 1, it abstracts away the type of the offset operand
> when building a POINTER_PLUS_EXPR.  It does so by introducing
> fold_build_pointer_plus_expr{_hwi,_loc} helpers and use them in all
> places that currently build POINTER_PLUS_EXPRs (including those
> that do not fold the result).  This patch will make steps 2 and more
> purely middle-end (fingers crossed).
> 
> Bootstrapped and tested on x86_64-unknown-linux-gnu for all languages.
> 
> I also built cc1 for all supported targets via contrib/config-list.mk
> and saw no fails that relate to this patch.
> 
> Are the frontend parts ok?

Ping.  Joseph seems to be on vacation - Richard, can you approve
the C frontend/family parts?

Thanks,
Richard.

> 2011-07-12  Richard Guenther  <rguenther@suse.de>
> 
> 	* tree.h (fold_build_pointer_plus_loc): New helper function.
> 	(fold_build_pointer_plus_hwi_loc): Likewise.
> 	(fold_build_pointer_plus): Define.
> 	(fold_build_pointer_plus_hwi): Likewise.
> 
> 	* builtins.c (std_gimplify_va_arg_expr): Use fold_build_pointer_plus.
> 	(fold_builtin_memory_op): Likewise.
> 	(fold_builtin_stpcpy): Likewise.
> 	(fold_builtin_memchr): Likewise.
> 	(fold_builtin_strstr): Likewise.
> 	(fold_builtin_strchr): Likewise.
> 	(fold_builtin_strrchr): Likewise.
> 	(fold_builtin_strpbrk): Likewise.
> 	(fold_builtin_strcat): Likewise.
> 	(expand_builtin_memory_chk): Likewise.
> 	(fold_builtin_memory_chk): Likewise.
> 	* c-typeck.c (build_unary_op): Likewise.
> 	* cgraphunit.c (thunk_adjust): Likewise.
> 	* fold-const.c (build_range_check): Likewise.
> 	(fold_binary_loc): Likewise.
> 	* omp-low.c (extract_omp_for_data): Likewise.
> 	(expand_omp_for_generic): Likewise.
> 	(expand_omp_for_static_nochunk): Likewise.
> 	(expand_omp_for_static_chunk): Likewise.
> 	* tree-affine.c (add_elt_to_tree): Likewise.
> 	* tree-data-ref.c (split_constant_offset_1): Likewise.
> 	* tree-loop-distribution.c (generate_memset_zero): Likewise.
> 	* tree-mudflap.c (mf_xform_derefs_1): Likewise.
> 	* tree-predcom.c (ref_at_iteration): Likewise.
> 	* tree-ssa-address.c (tree_mem_ref_addr): Likewise.
> 	(add_to_parts): Likewise.
> 	(create_mem_ref): Likewise.
> 	* tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Likewise.
> 	* tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Likewise.
> 	(number_of_iterations_le): Likewise.
> 	* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Likewise.
> 	* tree-vect-data-refs.c (vect_analyze_data_refs): Likewise.
> 	(vect_create_addr_base_for_vector_ref): Likewise.
> 	* tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Likewise.
> 	(vect_create_cond_for_alias_checks): Likewise.
> 	* tree-vrp.c (extract_range_from_assert): Likewise.
> 
> 	* config/alpha/alpha.c (alpha_va_start): Likewise.
> 	(alpha_gimplify_va_arg_1): Likewise.
> 	* config/i386/i386.c (ix86_va_start): Likewise.
> 	(ix86_gimplify_va_arg): Likewise.
> 	* config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise.
> 	* config/mep/mep.c (mep_expand_va_start): Likewise.
> 	(mep_gimplify_va_arg_expr): Likewise.
> 	* config/mips/mips.c (mips_va_start): Likewise.
> 	(mips_gimplify_va_arg_expr): Likewise.
> 	* config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise.
> 	* config/rs6000/rs6000.c (rs6000_va_start): Likewise.
> 	(rs6000_gimplify_va_arg): Likewise.
> 	* config/s390/s390.c (s390_va_start): Likewise.
> 	(s390_gimplify_va_arg): Likewise.
> 	* config/sh/sh.c (sh_va_start): Likewise.
> 	(sh_gimplify_va_arg_expr): Likewise.
> 	* config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise.
> 	* config/spu/spu.c (spu_va_start): Likewise.
> 	(spu_gimplify_va_arg_expr): Likewise.
> 	* config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start):
> 	Likewise.
> 	(xstormy16_gimplify_va_arg_expr): Likewise.
> 	* config/xtensa/xtensa.c (xtensa_va_start): Likewise.
> 	(xtensa_gimplify_va_arg_expr): Likewise.
> 
> 	c-family/
> 	* c-common.c (pointer_int_sum): Use fold_build_pointer_plus.
> 	* c-omp.c (c_finish_omp_for): Likewise.
> 
> 	cp/
> 	* call.c (build_special_member_call): Use fold_build_pointer_plus.
> 	* class.c (build_base_path): Likewise.
> 	(convert_to_base_statically): Likewise.
> 	(dfs_accumulate_vtbl_inits): Likewise.
> 	* cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
> 	* except.c (expand_start_catch_block): Likewise.
> 	* init.c (expand_virtual_init): Likewise.
> 	(build_new_1): Likewise.
> 	(build_vec_delete_1): Likewise.
> 	(build_vec_delete): Likewise.
> 	* rtti.c (build_headof): Likewise.
> 	(tinfo_base_init): Likewise.
> 	* typeck.c (get_member_function_from_ptrfunc): Likewise.
> 	(cp_build_addr_expr_1): Likewise.
> 	* typeck2.c (build_m_component_ref): Likewise.
> 
> 	fortran/
> 	* trans-expr.c (fill_with_spaces): Use fold_build_pointer_plus.
> 	(gfc_trans_string_copy): Likewise.
> 	* trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise.
> 	* trans-types.c (gfc_get_array_descr_info): Likewise.
> 	* trans.c (gfc_build_array_ref): Likewise.
> 
> 	java/
> 	* builtins.c (static): Use fold_build_pointer_plus.
> 	* class.c (make_class_data): Likewise.
> 	(build_symbol_entry): Likewise.
> 	* except.c (build_exception_object_ref): Likewise.
> 	* expr.c (build_java_arrayaccess): Likewise.
> 	(build_field_ref): Likewise.
> 	(build_known_method_ref): Likewise.
> 	(build_invokevirtual): Likewise.
> 
> 	objc/
> 	* objc-next-runtime-abi-02.c (objc_v2_build_ivar_ref):
> 	Use fold_build_pointer_plus.
> 	(objc2_build_ehtype_initializer): Likewise.
> 
> Index: trunk/gcc/builtins.c
> ===================================================================
> *** trunk.orig/gcc/builtins.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/builtins.c	2011-07-11 17:13:24.000000000 +0200
> *************** std_gimplify_va_arg_expr (tree valist, t
> *** 4236,4244 ****
>         && !integer_zerop (TYPE_SIZE (type)))
>       {
>         t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
> ! 		  fold_build2 (POINTER_PLUS_EXPR,
> ! 			       TREE_TYPE (valist),
> ! 			       valist_tmp, size_int (boundary - 1)));
>         gimplify_and_add (t, pre_p);
>   
>         t = fold_convert (sizetype, valist_tmp);
> --- 4236,4242 ----
>         && !integer_zerop (TYPE_SIZE (type)))
>       {
>         t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
> ! 		  fold_build_pointer_plus_hwi (valist_tmp, boundary - 1));
>         gimplify_and_add (t, pre_p);
>   
>         t = fold_convert (sizetype, valist_tmp);
> *************** std_gimplify_va_arg_expr (tree valist, t
> *** 4277,4288 ****
>   		       rounded_size, size_int (align));
>         t = fold_build3 (COND_EXPR, sizetype, t, size_zero_node,
>   		       size_binop (MINUS_EXPR, rounded_size, type_size));
> !       addr = fold_build2 (POINTER_PLUS_EXPR,
> ! 			  TREE_TYPE (addr), addr, t);
>       }
>   
>     /* Compute new value for AP.  */
> !   t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (valist), valist_tmp, rounded_size);
>     t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
>     gimplify_and_add (t, pre_p);
>   
> --- 4275,4285 ----
>   		       rounded_size, size_int (align));
>         t = fold_build3 (COND_EXPR, sizetype, t, size_zero_node,
>   		       size_binop (MINUS_EXPR, rounded_size, type_size));
> !       addr = fold_build_pointer_plus (addr, t);
>       }
>   
>     /* Compute new value for AP.  */
> !   t = fold_build_pointer_plus (valist_tmp, rounded_size);
>     t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
>     gimplify_and_add (t, pre_p);
>   
> *************** fold_builtin_memory_op (location_t loc,
> *** 8222,8229 ****
>       len = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (len), len,
>   		       ssize_int (1));
>   
> !   len = fold_convert_loc (loc, sizetype, len);
> !   dest = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (dest), dest, len);
>     dest = fold_convert_loc (loc, type, dest);
>     if (expr)
>       dest = omit_one_operand_loc (loc, type, dest, expr);
> --- 8219,8225 ----
>       len = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (len), len,
>   		       ssize_int (1));
>   
> !   dest = fold_build_pointer_plus_loc (loc, dest, len);
>     dest = fold_convert_loc (loc, type, dest);
>     if (expr)
>       dest = omit_one_operand_loc (loc, type, dest, expr);
> *************** fold_builtin_stpcpy (location_t loc, tre
> *** 8299,8306 ****
>     call = build_call_expr_loc (loc, fn, 3, dest, src, lenp1);
>   
>     type = TREE_TYPE (TREE_TYPE (fndecl));
> !   len = fold_convert_loc (loc, sizetype, len);
> !   dest = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (dest), dest, len);
>     dest = fold_convert_loc (loc, type, dest);
>     dest = omit_one_operand_loc (loc, type, dest, call);
>     return dest;
> --- 8295,8301 ----
>     call = build_call_expr_loc (loc, fn, 3, dest, src, lenp1);
>   
>     type = TREE_TYPE (TREE_TYPE (fndecl));
> !   dest = fold_build_pointer_plus_loc (loc, dest, len);
>     dest = fold_convert_loc (loc, type, dest);
>     dest = omit_one_operand_loc (loc, type, dest, call);
>     return dest;
> *************** fold_builtin_memchr (location_t loc, tre
> *** 8387,8394 ****
>   	  if (r == NULL)
>   	    return build_int_cst (TREE_TYPE (arg1), 0);
>   
> ! 	  tem = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (arg1), arg1,
> ! 			     size_int (r - p1));
>   	  return fold_convert_loc (loc, type, tem);
>   	}
>         return NULL_TREE;
> --- 8382,8388 ----
>   	  if (r == NULL)
>   	    return build_int_cst (TREE_TYPE (arg1), 0);
>   
> ! 	  tem = fold_build_pointer_plus_hwi_loc (loc, arg1, r - p1);
>   	  return fold_convert_loc (loc, type, tem);
>   	}
>         return NULL_TREE;
> *************** fold_builtin_strstr (location_t loc, tre
> *** 10775,10782 ****
>   	    return build_int_cst (TREE_TYPE (s1), 0);
>   
>   	  /* Return an offset into the constant string argument.  */
> ! 	  tem = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (s1),
> ! 			     s1, size_int (r - p1));
>   	  return fold_convert_loc (loc, type, tem);
>   	}
>   
> --- 10769,10775 ----
>   	    return build_int_cst (TREE_TYPE (s1), 0);
>   
>   	  /* Return an offset into the constant string argument.  */
> ! 	  tem = fold_build_pointer_plus_hwi_loc (loc, s1, r - p1);
>   	  return fold_convert_loc (loc, type, tem);
>   	}
>   
> *************** fold_builtin_strchr (location_t loc, tre
> *** 10846,10853 ****
>   	    return build_int_cst (TREE_TYPE (s1), 0);
>   
>   	  /* Return an offset into the constant string argument.  */
> ! 	  tem = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (s1),
> ! 			     s1, size_int (r - p1));
>   	  return fold_convert_loc (loc, type, tem);
>   	}
>         return NULL_TREE;
> --- 10839,10845 ----
>   	    return build_int_cst (TREE_TYPE (s1), 0);
>   
>   	  /* Return an offset into the constant string argument.  */
> ! 	  tem = fold_build_pointer_plus_hwi_loc (loc, s1, r - p1);
>   	  return fold_convert_loc (loc, type, tem);
>   	}
>         return NULL_TREE;
> *************** fold_builtin_strrchr (location_t loc, tr
> *** 10902,10909 ****
>   	    return build_int_cst (TREE_TYPE (s1), 0);
>   
>   	  /* Return an offset into the constant string argument.  */
> ! 	  tem = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (s1),
> ! 			     s1, size_int (r - p1));
>   	  return fold_convert_loc (loc, type, tem);
>   	}
>   
> --- 10894,10900 ----
>   	    return build_int_cst (TREE_TYPE (s1), 0);
>   
>   	  /* Return an offset into the constant string argument.  */
> ! 	  tem = fold_build_pointer_plus_hwi_loc (loc, s1, r - p1);
>   	  return fold_convert_loc (loc, type, tem);
>   	}
>   
> *************** fold_builtin_strpbrk (location_t loc, tr
> *** 10962,10969 ****
>   	    return build_int_cst (TREE_TYPE (s1), 0);
>   
>   	  /* Return an offset into the constant string argument.  */
> ! 	  tem = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (s1),
> ! 			     s1, size_int (r - p1));
>   	  return fold_convert_loc (loc, type, tem);
>   	}
>   
> --- 10953,10959 ----
>   	    return build_int_cst (TREE_TYPE (s1), 0);
>   
>   	  /* Return an offset into the constant string argument.  */
> ! 	  tem = fold_build_pointer_plus_hwi_loc (loc, s1, r - p1);
>   	  return fold_convert_loc (loc, type, tem);
>   	}
>   
> *************** fold_builtin_strcat (location_t loc ATTR
> *** 11047,11054 ****
>   	  newdst = build_call_expr_loc (loc, strlen_fn, 1, dst);
>   	  /* Create (dst p+ strlen (dst)).  */
>   
> ! 	  newdst = fold_build2_loc (loc, POINTER_PLUS_EXPR,
> ! 				TREE_TYPE (dst), dst, newdst);
>   	  newdst = builtin_save_expr (newdst);
>   
>   	  call = build_call_expr_loc (loc, strcpy_fn, 2, newdst, src);
> --- 11037,11043 ----
>   	  newdst = build_call_expr_loc (loc, strlen_fn, 1, dst);
>   	  /* Create (dst p+ strlen (dst)).  */
>   
> ! 	  newdst = fold_build_pointer_plus_loc (loc, dst, newdst);
>   	  newdst = builtin_save_expr (newdst);
>   
>   	  call = build_call_expr_loc (loc, strcpy_fn, 2, newdst, src);
> *************** expand_builtin_memory_chk (tree exp, rtx
> *** 11721,11727 ****
>   	      return expand_expr (dest, target, mode, EXPAND_NORMAL);
>   	    }
>   
> ! 	  expr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (dest), dest, len);
>   	  return expand_expr (expr, target, mode, EXPAND_NORMAL);
>   	}
>   
> --- 11710,11716 ----
>   	      return expand_expr (dest, target, mode, EXPAND_NORMAL);
>   	    }
>   
> ! 	  expr = fold_build_pointer_plus (dest, len);
>   	  return expand_expr (expr, target, mode, EXPAND_NORMAL);
>   	}
>   
> *************** fold_builtin_memory_chk (location_t loc,
> *** 11981,11988 ****
>   				 dest, len);
>         else
>   	{
> ! 	  tree temp = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (dest),
> ! 				   dest, len);
>   	  return fold_convert_loc (loc, TREE_TYPE (TREE_TYPE (fndecl)), temp);
>   	}
>       }
> --- 11970,11976 ----
>   				 dest, len);
>         else
>   	{
> ! 	  tree temp = fold_build_pointer_plus_loc (loc, dest, len);
>   	  return fold_convert_loc (loc, TREE_TYPE (TREE_TYPE (fndecl)), temp);
>   	}
>       }
> Index: trunk/gcc/c-typeck.c
> ===================================================================
> *** trunk.orig/gcc/c-typeck.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/c-typeck.c	2011-07-11 17:13:24.000000000 +0200
> *************** build_unary_op (location_t location,
> *** 3789,3799 ****
>         if (val && TREE_CODE (val) == INDIRECT_REF
>             && TREE_CONSTANT (TREE_OPERAND (val, 0)))
>   	{
> ! 	  tree op0 = fold_convert_loc (location, sizetype,
> ! 				       fold_offsetof (arg, val)), op1;
>   
>   	  op1 = fold_convert_loc (location, argtype, TREE_OPERAND (val, 0));
> ! 	  ret = fold_build2_loc (location, POINTER_PLUS_EXPR, argtype, op1, op0);
>   	  goto return_build_unary_op;
>   	}
>   
> --- 3789,3798 ----
>         if (val && TREE_CODE (val) == INDIRECT_REF
>             && TREE_CONSTANT (TREE_OPERAND (val, 0)))
>   	{
> ! 	  tree op0 = fold_offsetof (arg, val), op1;
>   
>   	  op1 = fold_convert_loc (location, argtype, TREE_OPERAND (val, 0));
> ! 	  ret = fold_build_pointer_plus_loc (location, op1, op0);
>   	  goto return_build_unary_op;
>   	}
>   
> Index: trunk/gcc/cgraphunit.c
> ===================================================================
> *** trunk.orig/gcc/cgraphunit.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/cgraphunit.c	2011-07-11 17:13:24.000000000 +0200
> *************** thunk_adjust (gimple_stmt_iterator * bsi
> *** 1458,1468 ****
>     if (this_adjusting
>         && fixed_offset != 0)
>       {
> !       stmt = gimple_build_assign (ptr,
> ! 				  fold_build2_loc (input_location,
> ! 						   POINTER_PLUS_EXPR,
> ! 						   TREE_TYPE (ptr), ptr,
> ! 						   size_int (fixed_offset)));
>         gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
>       }
>   
> --- 1458,1467 ----
>     if (this_adjusting
>         && fixed_offset != 0)
>       {
> !       stmt = gimple_build_assign
> ! 		(ptr, fold_build_pointer_plus_hwi_loc (input_location,
> ! 						       ptr,
> ! 						       fixed_offset));
>         gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
>       }
>   
> *************** thunk_adjust (gimple_stmt_iterator * bsi
> *** 1508,1519 ****
>   
>         /* Find the entry with the vcall offset.  */
>         stmt = gimple_build_assign (vtabletmp2,
> ! 				  fold_build2_loc (input_location,
> ! 						   POINTER_PLUS_EXPR,
> ! 						   TREE_TYPE (vtabletmp2),
> ! 						   vtabletmp2,
> ! 						   fold_convert (sizetype,
> ! 								 virtual_offset)));
>         gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
>   
>         /* Get the offset itself.  */
> --- 1507,1515 ----
>   
>         /* Find the entry with the vcall offset.  */
>         stmt = gimple_build_assign (vtabletmp2,
> ! 				  fold_build_pointer_plus_loc (input_location,
> ! 							       vtabletmp2,
> ! 							       virtual_offset));
>         gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
>   
>         /* Get the offset itself.  */
> *************** thunk_adjust (gimple_stmt_iterator * bsi
> *** 1533,1541 ****
>         find_referenced_vars_in (stmt);
>   
>         /* Adjust the `this' pointer.  */
> !       ptr = fold_build2_loc (input_location,
> ! 			     POINTER_PLUS_EXPR, TREE_TYPE (ptr), ptr,
> ! 			     offsettmp);
>       }
>   
>     if (!this_adjusting
> --- 1529,1535 ----
>         find_referenced_vars_in (stmt);
>   
>         /* Adjust the `this' pointer.  */
> !       ptr = fold_build_pointer_plus_loc (input_location, ptr, offsettmp);
>       }
>   
>     if (!this_adjusting
> *************** thunk_adjust (gimple_stmt_iterator * bsi
> *** 1554,1562 ****
>   	  mark_symbols_for_renaming (stmt);
>   	  find_referenced_vars_in (stmt);
>   	}
> !       ptr = fold_build2_loc (input_location,
> ! 			     POINTER_PLUS_EXPR, TREE_TYPE (ptrtmp), ptrtmp,
> ! 			     size_int (fixed_offset));
>       }
>   
>     /* Emit the statement and gimplify the adjustment expression.  */
> --- 1548,1555 ----
>   	  mark_symbols_for_renaming (stmt);
>   	  find_referenced_vars_in (stmt);
>   	}
> !       ptr = fold_build_pointer_plus_hwi_loc (input_location,
> ! 					     ptrtmp, fixed_offset);
>       }
>   
>     /* Emit the statement and gimplify the adjustment expression.  */
> Index: trunk/gcc/fold-const.c
> ===================================================================
> *** trunk.orig/gcc/fold-const.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/fold-const.c	2011-07-11 17:13:24.000000000 +0200
> *************** build_range_check (location_t loc, tree
> *** 4221,4228 ****
>   	  low = fold_convert_loc (loc, sizetype, low);
>   	  low = fold_build1_loc (loc, NEGATE_EXPR, sizetype, low);
>             return build_range_check (loc, type,
> ! 			     	    fold_build2_loc (loc, POINTER_PLUS_EXPR,
> ! 						 etype, exp, low),
>   			            1, build_int_cst (etype, 0), value);
>   	}
>         return 0;
> --- 4221,4227 ----
>   	  low = fold_convert_loc (loc, sizetype, low);
>   	  low = fold_build1_loc (loc, NEGATE_EXPR, sizetype, low);
>             return build_range_check (loc, type,
> ! 			     	    fold_build_pointer_plus_loc (loc, exp, low),
>   			            1, build_int_cst (etype, 0), value);
>   	}
>         return 0;
> *************** fold_binary_loc (location_t loc,
> *** 9584,9592 ****
>   	  inner = fold_build2_loc (loc, PLUS_EXPR, sizetype,
>   			       arg01, fold_convert_loc (loc, sizetype, arg1));
>   	  return fold_convert_loc (loc, type,
> ! 				   fold_build2_loc (loc, POINTER_PLUS_EXPR,
> ! 						TREE_TYPE (arg00),
> ! 						arg00, inner));
>   	}
>   
>         /* PTR_CST +p CST -> CST1 */
> --- 9583,9590 ----
>   	  inner = fold_build2_loc (loc, PLUS_EXPR, sizetype,
>   			       arg01, fold_convert_loc (loc, sizetype, arg1));
>   	  return fold_convert_loc (loc, type,
> ! 				   fold_build_pointer_plus_loc (loc,
> ! 								arg00, inner));
>   	}
>   
>         /* PTR_CST +p CST -> CST1 */
> Index: trunk/gcc/omp-low.c
> ===================================================================
> *** trunk.orig/gcc/omp-low.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/omp-low.c	2011-07-11 17:13:24.000000000 +0200
> *************** extract_omp_for_data (gimple for_stmt, s
> *** 310,318 ****
>   	  break;
>   	case LE_EXPR:
>   	  if (POINTER_TYPE_P (TREE_TYPE (loop->n2)))
> ! 	    loop->n2 = fold_build2_loc (loc,
> ! 				    POINTER_PLUS_EXPR, TREE_TYPE (loop->n2),
> ! 				    loop->n2, size_one_node);
>   	  else
>   	    loop->n2 = fold_build2_loc (loc,
>   				    PLUS_EXPR, TREE_TYPE (loop->n2), loop->n2,
> --- 310,316 ----
>   	  break;
>   	case LE_EXPR:
>   	  if (POINTER_TYPE_P (TREE_TYPE (loop->n2)))
> ! 	    loop->n2 = fold_build_pointer_plus_hwi_loc (loc, loop->n2, 1);
>   	  else
>   	    loop->n2 = fold_build2_loc (loc,
>   				    PLUS_EXPR, TREE_TYPE (loop->n2), loop->n2,
> *************** extract_omp_for_data (gimple for_stmt, s
> *** 321,329 ****
>   	  break;
>   	case GE_EXPR:
>   	  if (POINTER_TYPE_P (TREE_TYPE (loop->n2)))
> ! 	    loop->n2 = fold_build2_loc (loc,
> ! 				    POINTER_PLUS_EXPR, TREE_TYPE (loop->n2),
> ! 				    loop->n2, size_int (-1));
>   	  else
>   	    loop->n2 = fold_build2_loc (loc,
>   				    MINUS_EXPR, TREE_TYPE (loop->n2), loop->n2,
> --- 319,325 ----
>   	  break;
>   	case GE_EXPR:
>   	  if (POINTER_TYPE_P (TREE_TYPE (loop->n2)))
> ! 	    loop->n2 = fold_build_pointer_plus_hwi_loc (loc, loop->n2, -1);
>   	  else
>   	    loop->n2 = fold_build2_loc (loc,
>   				    MINUS_EXPR, TREE_TYPE (loop->n2), loop->n2,
> *************** expand_omp_for_generic (struct omp_regio
> *** 3914,3921 ****
>   	  t = fold_build2 (MULT_EXPR, itype, t,
>   			   fold_convert (itype, fd->loops[i].step));
>   	  if (POINTER_TYPE_P (vtype))
> ! 	    t = fold_build2 (POINTER_PLUS_EXPR, vtype,
> ! 			     fd->loops[i].n1, fold_convert (sizetype, t));
>   	  else
>   	    t = fold_build2 (PLUS_EXPR, itype, fd->loops[i].n1, t);
>   	  t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
> --- 3910,3916 ----
>   	  t = fold_build2 (MULT_EXPR, itype, t,
>   			   fold_convert (itype, fd->loops[i].step));
>   	  if (POINTER_TYPE_P (vtype))
> ! 	    t = fold_build_pointer_plus (fd->loops[i].n1, t);
>   	  else
>   	    t = fold_build2 (PLUS_EXPR, itype, fd->loops[i].n1, t);
>   	  t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
> *************** expand_omp_for_generic (struct omp_regio
> *** 3944,3951 ****
>         vback = gimple_omp_continue_control_def (stmt);
>   
>         if (POINTER_TYPE_P (type))
> ! 	t = fold_build2 (POINTER_PLUS_EXPR, type, vmain,
> ! 			 fold_convert (sizetype, fd->loop.step));
>         else
>   	t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
>         t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
> --- 3939,3945 ----
>         vback = gimple_omp_continue_control_def (stmt);
>   
>         if (POINTER_TYPE_P (type))
> ! 	t = fold_build_pointer_plus (vmain, fd->loop.step);
>         else
>   	t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
>         t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
> *************** expand_omp_for_generic (struct omp_regio
> *** 3989,3997 ****
>   	      set_immediate_dominator (CDI_DOMINATORS, bb, last_bb);
>   
>   	      if (POINTER_TYPE_P (vtype))
> ! 		t = fold_build2 (POINTER_PLUS_EXPR, vtype,
> ! 				 fd->loops[i].v,
> ! 				 fold_convert (sizetype, fd->loops[i].step));
>   	      else
>   		t = fold_build2 (PLUS_EXPR, vtype, fd->loops[i].v,
>   				 fd->loops[i].step);
> --- 3983,3989 ----
>   	      set_immediate_dominator (CDI_DOMINATORS, bb, last_bb);
>   
>   	      if (POINTER_TYPE_P (vtype))
> ! 		t = fold_build_pointer_plus (fd->loops[i].v, fd->loops[i].step);
>   	      else
>   		t = fold_build2 (PLUS_EXPR, vtype, fd->loops[i].v,
>   				 fd->loops[i].step);
> *************** expand_omp_for_static_nochunk (struct om
> *** 4239,4246 ****
>     t = fold_convert (itype, s0);
>     t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
>     if (POINTER_TYPE_P (type))
> !     t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1,
> ! 		     fold_convert (sizetype, t));
>     else
>       t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
>     t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
> --- 4231,4237 ----
>     t = fold_convert (itype, s0);
>     t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
>     if (POINTER_TYPE_P (type))
> !     t = fold_build_pointer_plus (fd->loop.n1, t);
>     else
>       t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
>     t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
> *************** expand_omp_for_static_nochunk (struct om
> *** 4251,4258 ****
>     t = fold_convert (itype, e0);
>     t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
>     if (POINTER_TYPE_P (type))
> !     t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1,
> ! 		     fold_convert (sizetype, t));
>     else
>       t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
>     e = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
> --- 4242,4248 ----
>     t = fold_convert (itype, e0);
>     t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
>     if (POINTER_TYPE_P (type))
> !     t = fold_build_pointer_plus (fd->loop.n1, t);
>     else
>       t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
>     e = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
> *************** expand_omp_for_static_nochunk (struct om
> *** 4267,4274 ****
>     vback = gimple_omp_continue_control_def (stmt);
>   
>     if (POINTER_TYPE_P (type))
> !     t = fold_build2 (POINTER_PLUS_EXPR, type, vmain,
> ! 		     fold_convert (sizetype, fd->loop.step));
>     else
>       t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
>     t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
> --- 4257,4263 ----
>     vback = gimple_omp_continue_control_def (stmt);
>   
>     if (POINTER_TYPE_P (type))
> !     t = fold_build_pointer_plus (vmain, fd->loop.step);
>     else
>       t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
>     t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
> *************** expand_omp_for_static_chunk (struct omp_
> *** 4442,4449 ****
>     t = fold_build2 (MULT_EXPR, itype, threadid, fd->chunk_size);
>     t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
>     if (POINTER_TYPE_P (type))
> !     t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1,
> ! 		     fold_convert (sizetype, t));
>     else
>       t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
>     v_extra = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
> --- 4431,4437 ----
>     t = fold_build2 (MULT_EXPR, itype, threadid, fd->chunk_size);
>     t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
>     if (POINTER_TYPE_P (type))
> !     t = fold_build_pointer_plus (fd->loop.n1, t);
>     else
>       t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
>     v_extra = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
> *************** expand_omp_for_static_chunk (struct omp_
> *** 4475,4482 ****
>     t = fold_convert (itype, s0);
>     t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
>     if (POINTER_TYPE_P (type))
> !     t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1,
> ! 		     fold_convert (sizetype, t));
>     else
>       t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
>     t = force_gimple_operand_gsi (&si, t, false, NULL_TREE,
> --- 4463,4469 ----
>     t = fold_convert (itype, s0);
>     t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
>     if (POINTER_TYPE_P (type))
> !     t = fold_build_pointer_plus (fd->loop.n1, t);
>     else
>       t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
>     t = force_gimple_operand_gsi (&si, t, false, NULL_TREE,
> *************** expand_omp_for_static_chunk (struct omp_
> *** 4487,4494 ****
>     t = fold_convert (itype, e0);
>     t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
>     if (POINTER_TYPE_P (type))
> !     t = fold_build2 (POINTER_PLUS_EXPR, type, fd->loop.n1,
> ! 		     fold_convert (sizetype, t));
>     else
>       t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
>     e = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
> --- 4474,4480 ----
>     t = fold_convert (itype, e0);
>     t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
>     if (POINTER_TYPE_P (type))
> !     t = fold_build_pointer_plus (fd->loop.n1, t);
>     else
>       t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
>     e = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
> *************** expand_omp_for_static_chunk (struct omp_
> *** 4503,4510 ****
>     v_back = gimple_omp_continue_control_def (stmt);
>   
>     if (POINTER_TYPE_P (type))
> !     t = fold_build2 (POINTER_PLUS_EXPR, type, v_main,
> ! 		     fold_convert (sizetype, fd->loop.step));
>     else
>       t = fold_build2 (PLUS_EXPR, type, v_main, fd->loop.step);
>     stmt = gimple_build_assign (v_back, t);
> --- 4489,4495 ----
>     v_back = gimple_omp_continue_control_def (stmt);
>   
>     if (POINTER_TYPE_P (type))
> !     t = fold_build_pointer_plus (v_main, fd->loop.step);
>     else
>       t = fold_build2 (PLUS_EXPR, type, v_main, fd->loop.step);
>     stmt = gimple_build_assign (v_back, t);
> Index: trunk/gcc/tree-affine.c
> ===================================================================
> *** trunk.orig/gcc/tree-affine.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-affine.c	2011-07-11 17:13:24.000000000 +0200
> *************** add_elt_to_tree (tree expr, tree type, t
> *** 387,393 ****
>   	return fold_convert (type, elt);
>   
>         if (POINTER_TYPE_P (type))
> !         return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
>         return fold_build2 (PLUS_EXPR, type, expr, elt);
>       }
>   
> --- 387,393 ----
>   	return fold_convert (type, elt);
>   
>         if (POINTER_TYPE_P (type))
> !         return fold_build_pointer_plus (expr, elt);
>         return fold_build2 (PLUS_EXPR, type, expr, elt);
>       }
>   
> *************** add_elt_to_tree (tree expr, tree type, t
> *** 399,405 ****
>         if (POINTER_TYPE_P (type))
>   	{
>   	  elt = fold_build1 (NEGATE_EXPR, type1, elt);
> ! 	  return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
>   	}
>         return fold_build2 (MINUS_EXPR, type, expr, elt);
>       }
> --- 399,405 ----
>         if (POINTER_TYPE_P (type))
>   	{
>   	  elt = fold_build1 (NEGATE_EXPR, type1, elt);
> ! 	  return fold_build_pointer_plus (expr, elt);
>   	}
>         return fold_build2 (MINUS_EXPR, type, expr, elt);
>       }
> *************** add_elt_to_tree (tree expr, tree type, t
> *** 423,429 ****
>       {
>         if (code == MINUS_EXPR)
>           elt = fold_build1 (NEGATE_EXPR, type1, elt);
> !       return fold_build2 (POINTER_PLUS_EXPR, type, expr, elt);
>       }
>     return fold_build2 (code, type, expr, elt);
>   }
> --- 423,429 ----
>       {
>         if (code == MINUS_EXPR)
>           elt = fold_build1 (NEGATE_EXPR, type1, elt);
> !       return fold_build_pointer_plus (expr, elt);
>       }
>     return fold_build2 (code, type, expr, elt);
>   }
> Index: trunk/gcc/tree-data-ref.c
> ===================================================================
> *** trunk.orig/gcc/tree-data-ref.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-data-ref.c	2011-07-11 17:13:24.000000000 +0200
> *************** split_constant_offset_1 (tree type, tree
> *** 604,611 ****
>   	    split_constant_offset (poffset, &poffset, &off1);
>   	    off0 = size_binop (PLUS_EXPR, off0, off1);
>   	    if (POINTER_TYPE_P (TREE_TYPE (base)))
> ! 	      base = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (base),
> ! 				  base, fold_convert (sizetype, poffset));
>   	    else
>   	      base = fold_build2 (PLUS_EXPR, TREE_TYPE (base), base,
>   				  fold_convert (TREE_TYPE (base), poffset));
> --- 604,610 ----
>   	    split_constant_offset (poffset, &poffset, &off1);
>   	    off0 = size_binop (PLUS_EXPR, off0, off1);
>   	    if (POINTER_TYPE_P (TREE_TYPE (base)))
> ! 	      base = fold_build_pointer_plus (base, poffset);
>   	    else
>   	      base = fold_build2 (PLUS_EXPR, TREE_TYPE (base), base,
>   				  fold_convert (TREE_TYPE (base), poffset));
> Index: trunk/gcc/tree-loop-distribution.c
> ===================================================================
> *** trunk.orig/gcc/tree-loop-distribution.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-loop-distribution.c	2011-07-11 17:13:24.000000000 +0200
> *************** generate_memset_zero (gimple stmt, tree
> *** 285,293 ****
>   				  TYPE_SIZE_UNIT (TREE_TYPE (op0)));
>       }
>   
> !   addr_base = fold_build2_loc (loc, POINTER_PLUS_EXPR,
> ! 			       TREE_TYPE (DR_BASE_ADDRESS (dr)),
> ! 			       DR_BASE_ADDRESS (dr), addr_base);
>     mem = force_gimple_operand (addr_base, &stmts, true, NULL);
>     gimple_seq_add_seq (&stmt_list, stmts);
>   
> --- 285,292 ----
>   				  TYPE_SIZE_UNIT (TREE_TYPE (op0)));
>       }
>   
> !   addr_base = fold_build_pointer_plus_loc (loc,
> ! 					   DR_BASE_ADDRESS (dr), addr_base);
>     mem = force_gimple_operand (addr_base, &stmts, true, NULL);
>     gimple_seq_add_seq (&stmt_list, stmts);
>   
> Index: trunk/gcc/tree-mudflap.c
> ===================================================================
> *** trunk.orig/gcc/tree-mudflap.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-mudflap.c	2011-07-11 17:13:24.000000000 +0200
> *************** mf_xform_derefs_1 (gimple_stmt_iterator
> *** 843,851 ****
>   	      elt = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (elt)),
>   			    elt);
>               addr = fold_convert_loc (location, ptr_type_node, elt ? elt : base);
> !             addr = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
> ! 				addr, fold_convert_loc (location, sizetype,
> ! 							byte_position (field)));
>             }
>           else
>             addr = build1 (ADDR_EXPR, build_pointer_type (type), t);
> --- 843,850 ----
>   	      elt = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (elt)),
>   			    elt);
>               addr = fold_convert_loc (location, ptr_type_node, elt ? elt : base);
> !             addr = fold_build_pointer_plus_loc (location,
> ! 						addr, byte_position (field));
>             }
>           else
>             addr = build1 (ADDR_EXPR, build_pointer_type (type), t);
> *************** mf_xform_derefs_1 (gimple_stmt_iterator
> *** 861,893 ****
>       case INDIRECT_REF:
>         addr = TREE_OPERAND (t, 0);
>         base = addr;
> !       limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
> ! 			   fold_build2_loc (location,
> ! 					POINTER_PLUS_EXPR, ptr_type_node, base,
> ! 					size),
> ! 			   size_int (-1));
>         break;
>   
>       case MEM_REF:
> !       addr = build2 (POINTER_PLUS_EXPR, TREE_TYPE (TREE_OPERAND (t, 1)),
> ! 		     TREE_OPERAND (t, 0),
> ! 		     fold_convert (sizetype, TREE_OPERAND (t, 1)));
>         base = addr;
> !       limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
> ! 			   fold_build2_loc (location,
> ! 					POINTER_PLUS_EXPR, ptr_type_node, base,
> ! 					size),
> ! 			   size_int (-1));
>         break;
>   
>       case TARGET_MEM_REF:
>         addr = tree_mem_ref_addr (ptr_type_node, t);
>         base = addr;
> !       limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
> ! 			   fold_build2_loc (location,
> ! 					POINTER_PLUS_EXPR, ptr_type_node, base,
> ! 					size),
> ! 			   size_int (-1));
>         break;
>   
>       case ARRAY_RANGE_REF:
> --- 860,883 ----
>       case INDIRECT_REF:
>         addr = TREE_OPERAND (t, 0);
>         base = addr;
> !       limit = fold_build_pointer_plus_hwi_loc
> ! 	  (location, fold_build_pointer_plus_loc (location, base, size), -1);
>         break;
>   
>       case MEM_REF:
> !       addr = fold_build_pointer_plus (TREE_OPERAND (t, 0), TREE_OPERAND (t, 1));
>         base = addr;
> !       limit = fold_build_pointer_plus_hwi_loc (location,
> ! 			       fold_build_pointer_plus_loc (location,
> ! 							    base, size), -1);
>         break;
>   
>       case TARGET_MEM_REF:
>         addr = tree_mem_ref_addr (ptr_type_node, t);
>         base = addr;
> !       limit = fold_build_pointer_plus_hwi_loc (location,
> ! 			   fold_build_pointer_plus_loc (location,
> ! 							base, size), -1);
>         break;
>   
>       case ARRAY_RANGE_REF:
> *************** mf_xform_derefs_1 (gimple_stmt_iterator
> *** 920,934 ****
>   
>           addr = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
>           addr = convert (ptr_type_node, addr);
> !         addr = fold_build2_loc (location, POINTER_PLUS_EXPR,
> ! 			    ptr_type_node, addr, ofs);
>   
>           base = addr;
> !         limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node,
> !                              fold_build2_loc (location,
> ! 					  POINTER_PLUS_EXPR, ptr_type_node,
> ! 					   base, size),
> !                              size_int (-1));
>         }
>         break;
>   
> --- 910,921 ----
>   
>           addr = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
>           addr = convert (ptr_type_node, addr);
> !         addr = fold_build_pointer_plus_loc (location, addr, ofs);
>   
>           base = addr;
> !         limit = fold_build_pointer_plus_hwi_loc (location,
> !                              fold_build_pointer_plus_loc (location,
> ! 							  base, size), -1);
>         }
>         break;
>   
> Index: trunk/gcc/tree-predcom.c
> ===================================================================
> *** trunk.orig/gcc/tree-predcom.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-predcom.c	2011-07-11 17:13:24.000000000 +0200
> *************** ref_at_iteration (struct loop *loop, tre
> *** 1396,1402 ****
>   	{
>   	  val = fold_build2 (MULT_EXPR, sizetype, iv.step,
>   			     size_int (iter));
> ! 	  val = fold_build2 (POINTER_PLUS_EXPR, type, iv.base, val);
>   	}
>         else
>   	{
> --- 1396,1402 ----
>   	{
>   	  val = fold_build2 (MULT_EXPR, sizetype, iv.step,
>   			     size_int (iter));
> ! 	  val = fold_build_pointer_plus (iv.base, val);
>   	}
>         else
>   	{
> Index: trunk/gcc/tree-ssa-address.c
> ===================================================================
> *** trunk.orig/gcc/tree-ssa-address.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-ssa-address.c	2011-07-11 17:23:28.000000000 +0200
> *************** tree_mem_ref_addr (tree type, tree mem_r
> *** 302,308 ****
>       }
>   
>     if (addr_off)
> !     addr = fold_build2 (POINTER_PLUS_EXPR, type, addr_base, addr_off);
>     else
>       addr = addr_base;
>   
> --- 302,308 ----
>       }
>   
>     if (addr_off)
> !     addr = fold_build_pointer_plus (addr_base, addr_off);
>     else
>       addr = addr_base;
>   
> *************** add_to_parts (struct mem_address *parts,
> *** 521,529 ****
>     /* Add ELT to base.  */
>     type = TREE_TYPE (parts->base);
>     if (POINTER_TYPE_P (type))
> !     parts->base = fold_build2 (POINTER_PLUS_EXPR, type,
> ! 			       parts->base,
> ! 			       fold_convert (sizetype, elt));
>     else
>       parts->base = fold_build2 (PLUS_EXPR, type,
>   			       parts->base, elt);
> --- 521,527 ----
>     /* Add ELT to base.  */
>     type = TREE_TYPE (parts->base);
>     if (POINTER_TYPE_P (type))
> !     parts->base = fold_build_pointer_plus (parts->base, elt);
>     else
>       parts->base = fold_build2 (PLUS_EXPR, type,
>   			       parts->base, elt);
> *************** create_mem_ref (gimple_stmt_iterator *gs
> *** 692,698 ****
>   		tree alias_ptr_type, tree iv_cand, tree base_hint, bool speed)
>   {
>     tree mem_ref, tmp;
> -   tree atype;
>     struct mem_address parts;
>   
>     addr_to_parts (type, addr, iv_cand, base_hint, &parts, speed);
> --- 690,695 ----
> *************** create_mem_ref (gimple_stmt_iterator *gs
> *** 731,741 ****
>   
>   	  if (parts.index)
>   	    {
> - 	      atype = TREE_TYPE (tmp);
>   	      parts.base = force_gimple_operand_gsi_1 (gsi,
> ! 			fold_build2 (POINTER_PLUS_EXPR, atype,
> ! 				     tmp,
> ! 				     fold_convert (sizetype, parts.base)),
>   			is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
>   	    }
>   	  else
> --- 728,735 ----
>   
>   	  if (parts.index)
>   	    {
>   	      parts.base = force_gimple_operand_gsi_1 (gsi,
> ! 			fold_build_pointer_plus (tmp, parts.base),
>   			is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
>   	    }
>   	  else
> *************** create_mem_ref (gimple_stmt_iterator *gs
> *** 758,768 ****
>         /* Add index to base.  */
>         if (parts.base)
>   	{
> - 	  atype = TREE_TYPE (parts.base);
>   	  parts.base = force_gimple_operand_gsi_1 (gsi,
> ! 			fold_build2 (POINTER_PLUS_EXPR, atype,
> ! 				     parts.base,
> ! 			    	     parts.index),
>   			is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
>   	}
>         else
> --- 752,759 ----
>         /* Add index to base.  */
>         if (parts.base)
>   	{
>   	  parts.base = force_gimple_operand_gsi_1 (gsi,
> ! 			fold_build_pointer_plus (parts.base, parts.index),
>   			is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
>   	}
>         else
> *************** create_mem_ref (gimple_stmt_iterator *gs
> *** 779,789 ****
>         /* Try adding offset to base.  */
>         if (parts.base)
>   	{
> - 	  atype = TREE_TYPE (parts.base);
>   	  parts.base = force_gimple_operand_gsi_1 (gsi,
> ! 			fold_build2 (POINTER_PLUS_EXPR, atype,
> ! 				     parts.base,
> ! 				     fold_convert (sizetype, parts.offset)),
>   			is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
>   	}
>         else
> --- 770,777 ----
>         /* Try adding offset to base.  */
>         if (parts.base)
>   	{
>   	  parts.base = force_gimple_operand_gsi_1 (gsi,
> ! 			fold_build_pointer_plus (parts.base, parts.offset),
>   			is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
>   	}
>         else
> Index: trunk/gcc/tree-ssa-loop-ivopts.c
> ===================================================================
> *** trunk.orig/gcc/tree-ssa-loop-ivopts.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-ssa-loop-ivopts.c	2011-07-11 17:13:24.000000000 +0200
> *************** force_expr_to_var_cost (tree expr, bool
> *** 3586,3594 ****
>   	  symbol_cost[i] = computation_cost (addr, i) + 1;
>   
>   	  address_cost[i]
> ! 	    = computation_cost (build2 (POINTER_PLUS_EXPR, type,
> ! 					addr,
> ! 					build_int_cst (sizetype, 2000)), i) + 1;
>   	  if (dump_file && (dump_flags & TDF_DETAILS))
>   	    {
>   	      fprintf (dump_file, "force_expr_to_var_cost %s costs:\n", i ? "speed" : "size");
> --- 3586,3592 ----
>   	  symbol_cost[i] = computation_cost (addr, i) + 1;
>   
>   	  address_cost[i]
> ! 	    = computation_cost (fold_build_pointer_plus_hwi (addr, 2000), i) + 1;
>   	  if (dump_file && (dump_flags & TDF_DETAILS))
>   	    {
>   	      fprintf (dump_file, "force_expr_to_var_cost %s costs:\n", i ? "speed" : "size");
> Index: trunk/gcc/tree-ssa-loop-niter.c
> ===================================================================
> *** trunk.orig/gcc/tree-ssa-loop-niter.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-ssa-loop-niter.c	2011-07-11 17:13:24.000000000 +0200
> *************** number_of_iterations_lt_to_ne (tree type
> *** 762,769 ****
>         else if (POINTER_TYPE_P (type))
>   	noloop = fold_build2 (GT_EXPR, boolean_type_node,
>   			      iv0->base,
> ! 			      fold_build2 (POINTER_PLUS_EXPR, type,
> ! 					   iv1->base, tmod));
>         else
>   	noloop = fold_build2 (GT_EXPR, boolean_type_node,
>   			      iv0->base,
> --- 762,768 ----
>         else if (POINTER_TYPE_P (type))
>   	noloop = fold_build2 (GT_EXPR, boolean_type_node,
>   			      iv0->base,
> ! 			      fold_build_pointer_plus (iv1->base, tmod));
>         else
>   	noloop = fold_build2 (GT_EXPR, boolean_type_node,
>   			      iv0->base,
> *************** number_of_iterations_lt_to_ne (tree type
> *** 788,797 ****
>   	noloop = boolean_false_node;
>         else if (POINTER_TYPE_P (type))
>   	noloop = fold_build2 (GT_EXPR, boolean_type_node,
> ! 			      fold_build2 (POINTER_PLUS_EXPR, type,
> ! 					   iv0->base,
> ! 					   fold_build1 (NEGATE_EXPR,
> ! 							type1, tmod)),
>   			      iv1->base);
>         else
>   	noloop = fold_build2 (GT_EXPR, boolean_type_node,
> --- 787,795 ----
>   	noloop = boolean_false_node;
>         else if (POINTER_TYPE_P (type))
>   	noloop = fold_build2 (GT_EXPR, boolean_type_node,
> ! 			      fold_build_pointer_plus (iv0->base,
> ! 						       fold_build1 (NEGATE_EXPR,
> ! 								    type1, tmod)),
>   			      iv1->base);
>         else
>   	noloop = fold_build2 (GT_EXPR, boolean_type_node,
> *************** number_of_iterations_le (tree type, affi
> *** 1166,1181 ****
>     if (integer_nonzerop (iv0->step))
>       {
>         if (POINTER_TYPE_P (type))
> ! 	iv1->base = fold_build2 (POINTER_PLUS_EXPR, type, iv1->base,
> ! 				 build_int_cst (type1, 1));
>         else
>   	iv1->base = fold_build2 (PLUS_EXPR, type1, iv1->base,
>   				 build_int_cst (type1, 1));
>       }
>     else if (POINTER_TYPE_P (type))
> !     iv0->base = fold_build2 (POINTER_PLUS_EXPR, type, iv0->base,
> ! 			     fold_build1 (NEGATE_EXPR, type1,
> ! 					  build_int_cst (type1, 1)));
>     else
>       iv0->base = fold_build2 (MINUS_EXPR, type1,
>   			     iv0->base, build_int_cst (type1, 1));
> --- 1164,1176 ----
>     if (integer_nonzerop (iv0->step))
>       {
>         if (POINTER_TYPE_P (type))
> ! 	iv1->base = fold_build_pointer_plus_hwi (iv1->base, 1);
>         else
>   	iv1->base = fold_build2 (PLUS_EXPR, type1, iv1->base,
>   				 build_int_cst (type1, 1));
>       }
>     else if (POINTER_TYPE_P (type))
> !     iv0->base = fold_build_pointer_plus_hwi (iv0->base, -1);
>     else
>       iv0->base = fold_build2 (MINUS_EXPR, type1,
>   			     iv0->base, build_int_cst (type1, 1));
> Index: trunk/gcc/tree-ssa-loop-prefetch.c
> ===================================================================
> *** trunk.orig/gcc/tree-ssa-loop-prefetch.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-ssa-loop-prefetch.c	2011-07-11 17:13:24.000000000 +0200
> *************** issue_prefetch_ref (struct mem_ref *ref,
> *** 1100,1107 ****
>             /* Determine the address to prefetch.  */
>             delta = (ahead + ap * ref->prefetch_mod) *
>   		   int_cst_value (ref->group->step);
> !           addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node,
> !                               addr_base, size_int (delta));
>             addr = force_gimple_operand_gsi (&bsi, unshare_expr (addr), true, NULL,
>                                              true, GSI_SAME_STMT);
>           }
> --- 1100,1106 ----
>             /* Determine the address to prefetch.  */
>             delta = (ahead + ap * ref->prefetch_mod) *
>   		   int_cst_value (ref->group->step);
> !           addr = fold_build_pointer_plus_hwi (addr_base, delta);
>             addr = force_gimple_operand_gsi (&bsi, unshare_expr (addr), true, NULL,
>                                              true, GSI_SAME_STMT);
>           }
> *************** issue_prefetch_ref (struct mem_ref *ref,
> *** 1112,1119 ****
>             forward = fold_build2 (MULT_EXPR, sizetype,
>                                    fold_convert (sizetype, ref->group->step),
>                                    fold_convert (sizetype, size_int (ahead)));
> !           addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, addr_base,
> ! 			      forward);
>             addr = force_gimple_operand_gsi (&bsi, unshare_expr (addr), true,
>   					   NULL, true, GSI_SAME_STMT);
>         }
> --- 1111,1117 ----
>             forward = fold_build2 (MULT_EXPR, sizetype,
>                                    fold_convert (sizetype, ref->group->step),
>                                    fold_convert (sizetype, size_int (ahead)));
> !           addr = fold_build_pointer_plus (addr_base, forward);
>             addr = force_gimple_operand_gsi (&bsi, unshare_expr (addr), true,
>   					   NULL, true, GSI_SAME_STMT);
>         }
> Index: trunk/gcc/tree-vect-data-refs.c
> ===================================================================
> *** trunk.orig/gcc/tree-vect-data-refs.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-vect-data-refs.c	2011-07-11 17:13:24.000000000 +0200
> *************** vect_analyze_data_refs (loop_vec_info lo
> *** 2645,2653 ****
>   	     inner-loop: *(BASE+INIT).  (The first location is actually
>   	     BASE+INIT+OFFSET, but we add OFFSET separately later).  */
>             tree inner_base = build_fold_indirect_ref
> !                                 (fold_build2 (POINTER_PLUS_EXPR,
> !                                               TREE_TYPE (base), base,
> !                                               fold_convert (sizetype, init)));
>   
>   	  if (vect_print_dump_info (REPORT_DETAILS))
>   	    {
> --- 2645,2651 ----
>   	     inner-loop: *(BASE+INIT).  (The first location is actually
>   	     BASE+INIT+OFFSET, but we add OFFSET separately later).  */
>             tree inner_base = build_fold_indirect_ref
> !                                 (fold_build_pointer_plus (base, init));
>   
>   	  if (vect_print_dump_info (REPORT_DETAILS))
>   	    {
> *************** vect_create_addr_base_for_vector_ref (gi
> *** 2928,2935 ****
>   
>     /* base + base_offset */
>     if (loop_vinfo)
> !     addr_base = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (data_ref_base),
> !                              data_ref_base, base_offset);
>     else
>       {
>         addr_base = build1 (ADDR_EXPR,
> --- 2926,2932 ----
>   
>     /* base + base_offset */
>     if (loop_vinfo)
> !     addr_base = fold_build_pointer_plus (data_ref_base, base_offset);
>     else
>       {
>         addr_base = build1 (ADDR_EXPR,
> Index: trunk/gcc/tree-vect-loop-manip.c
> ===================================================================
> *** trunk.orig/gcc/tree-vect-loop-manip.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-vect-loop-manip.c	2011-07-11 17:13:24.000000000 +0200
> *************** vect_update_ivs_after_vectorizer (loop_v
> *** 1819,1827 ****
>   			 fold_convert (TREE_TYPE (step_expr), niters),
>   			 step_expr);
>         if (POINTER_TYPE_P (TREE_TYPE (init_expr)))
> ! 	ni = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (init_expr),
> ! 			  init_expr,
> ! 			  fold_convert (sizetype, off));
>         else
>   	ni = fold_build2 (PLUS_EXPR, TREE_TYPE (init_expr),
>   			  init_expr,
> --- 1819,1825 ----
>   			 fold_convert (TREE_TYPE (step_expr), niters),
>   			 step_expr);
>         if (POINTER_TYPE_P (TREE_TYPE (init_expr)))
> ! 	ni = fold_build_pointer_plus (init_expr, off);
>         else
>   	ni = fold_build2 (PLUS_EXPR, TREE_TYPE (init_expr),
>   			  init_expr,
> *************** vect_create_cond_for_alias_checks (loop_
> *** 2471,2484 ****
>   	}
>   
>         seg_a_min = addr_base_a;
> !       seg_a_max = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (addr_base_a), 
> ! 			       addr_base_a, segment_length_a);
>         if (tree_int_cst_compare (DR_STEP (dr_a), size_zero_node) < 0)
>   	seg_a_min = seg_a_max, seg_a_max = addr_base_a;
>   
>         seg_b_min = addr_base_b;
> !       seg_b_max = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (addr_base_b),
> ! 			       addr_base_b, segment_length_b);
>         if (tree_int_cst_compare (DR_STEP (dr_b), size_zero_node) < 0)
>   	seg_b_min = seg_b_max, seg_b_max = addr_base_b;
>   
> --- 2469,2480 ----
>   	}
>   
>         seg_a_min = addr_base_a;
> !       seg_a_max = fold_build_pointer_plus (addr_base_a, segment_length_a);
>         if (tree_int_cst_compare (DR_STEP (dr_a), size_zero_node) < 0)
>   	seg_a_min = seg_a_max, seg_a_max = addr_base_a;
>   
>         seg_b_min = addr_base_b;
> !       seg_b_max = fold_build_pointer_plus (addr_base_b, segment_length_b);
>         if (tree_int_cst_compare (DR_STEP (dr_b), size_zero_node) < 0)
>   	seg_b_min = seg_b_max, seg_b_max = addr_base_b;
>   
> Index: trunk/gcc/tree-vrp.c
> ===================================================================
> *** trunk.orig/gcc/tree-vrp.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/tree-vrp.c	2011-07-11 17:13:24.000000000 +0200
> *************** extract_range_from_assert (value_range_t
> *** 1877,1884 ****
>   				   anti_max,
>   				   build_int_cst (TREE_TYPE (var_vr->min), 1));
>   	      else
> ! 		min = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (var_vr->min),
> ! 				   anti_max, size_int (1));
>   	      max = real_max;
>   	      set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
>   	    }
> --- 1877,1883 ----
>   				   anti_max,
>   				   build_int_cst (TREE_TYPE (var_vr->min), 1));
>   	      else
> ! 		min = fold_build_pointer_plus_hwi (anti_max, 1);
>   	      max = real_max;
>   	      set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
>   	    }
> *************** extract_range_from_assert (value_range_t
> *** 1905,1913 ****
>   				   anti_min,
>   				   build_int_cst (TREE_TYPE (var_vr->min), 1));
>   	      else
> ! 		max = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (var_vr->min),
> ! 				   anti_min,
> ! 				   size_int (-1));
>   	      min = real_min;
>   	      set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
>   	    }
> --- 1904,1910 ----
>   				   anti_min,
>   				   build_int_cst (TREE_TYPE (var_vr->min), 1));
>   	      else
> ! 		max = fold_build_pointer_plus_hwi (anti_min, -1);
>   	      min = real_min;
>   	      set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
>   	    }
> Index: trunk/gcc/c-family/c-common.c
> ===================================================================
> *** trunk.orig/gcc/c-family/c-common.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/c-family/c-common.c	2011-07-11 17:13:24.000000000 +0200
> *************** pointer_int_sum (location_t loc, enum tr
> *** 3760,3766 ****
>     if (resultcode == MINUS_EXPR)
>       intop = fold_build1_loc (loc, NEGATE_EXPR, sizetype, intop);
>   
> !   ret = fold_build2_loc (loc, POINTER_PLUS_EXPR, result_type, ptrop, intop);
>   
>     fold_undefer_and_ignore_overflow_warnings ();
>   
> --- 3760,3766 ----
>     if (resultcode == MINUS_EXPR)
>       intop = fold_build1_loc (loc, NEGATE_EXPR, sizetype, intop);
>   
> !   ret = fold_build_pointer_plus_loc (loc, ptrop, intop);
>   
>     fold_undefer_and_ignore_overflow_warnings ();
>   
> Index: trunk/gcc/c-family/c-omp.c
> ===================================================================
> *** trunk.orig/gcc/c-family/c-omp.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/c-family/c-omp.c	2011-07-11 17:13:24.000000000 +0200
> *************** c_finish_omp_for (location_t locus, tree
> *** 424,430 ****
>   		  if (TREE_CODE (incr) == POSTDECREMENT_EXPR
>   		      || TREE_CODE (incr) == PREDECREMENT_EXPR)
>   		    t = fold_build1_loc (elocus, NEGATE_EXPR, sizetype, t);
> ! 		  t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (decl), decl, t);
>   		  incr = build2 (MODIFY_EXPR, void_type_node, decl, t);
>   		}
>   	      break;
> --- 424,430 ----
>   		  if (TREE_CODE (incr) == POSTDECREMENT_EXPR
>   		      || TREE_CODE (incr) == PREDECREMENT_EXPR)
>   		    t = fold_build1_loc (elocus, NEGATE_EXPR, sizetype, t);
> ! 		  t = fold_build_pointer_plus (decl, t);
>   		  incr = build2 (MODIFY_EXPR, void_type_node, decl, t);
>   		}
>   	      break;
> Index: trunk/gcc/config/alpha/alpha.c
> ===================================================================
> *** trunk.orig/gcc/config/alpha/alpha.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/alpha/alpha.c	2011-07-11 17:13:24.000000000 +0200
> *************** alpha_va_start (tree valist, rtx nextarg
> *** 5990,5997 ****
>     if (TARGET_ABI_OPEN_VMS)
>       {
>         t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
> !       t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
> ! 		 size_int (offset + NUM_ARGS * UNITS_PER_WORD));
>         t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
>         TREE_SIDE_EFFECTS (t) = 1;
>         expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 5990,5996 ----
>     if (TARGET_ABI_OPEN_VMS)
>       {
>         t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
> !       t = fold_build_pointer_plus_hwi (t, offset + NUM_ARGS * UNITS_PER_WORD);
>         t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
>         TREE_SIDE_EFFECTS (t) = 1;
>         expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** alpha_va_start (tree valist, rtx nextarg
> *** 6007,6014 ****
>   			     valist, offset_field, NULL_TREE);
>   
>         t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
> !       t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
> ! 		  size_int (offset));
>         t = build2 (MODIFY_EXPR, TREE_TYPE (base_field), base_field, t);
>         TREE_SIDE_EFFECTS (t) = 1;
>         expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 6006,6012 ----
>   			     valist, offset_field, NULL_TREE);
>   
>         t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
> !       t = fold_build_pointer_plus_hwi (t, offset);
>         t = build2 (MODIFY_EXPR, TREE_TYPE (base_field), base_field, t);
>         TREE_SIDE_EFFECTS (t) = 1;
>         expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** alpha_gimplify_va_arg_1 (tree type, tree
> *** 6069,6076 ****
>       }
>   
>     /* Build the final address and force that value into a temporary.  */
> !   addr = build2 (POINTER_PLUS_EXPR, ptr_type, fold_convert (ptr_type, base),
> ! 	         fold_convert (sizetype, addend));
>     internal_post = NULL;
>     gimplify_expr (&addr, pre_p, &internal_post, is_gimple_val, fb_rvalue);
>     gimple_seq_add_seq (pre_p, internal_post);
> --- 6067,6073 ----
>       }
>   
>     /* Build the final address and force that value into a temporary.  */
> !   addr = fold_build_pointer_plus (fold_convert (ptr_type, base), addend);
>     internal_post = NULL;
>     gimplify_expr (&addr, pre_p, &internal_post, is_gimple_val, fb_rvalue);
>     gimple_seq_add_seq (pre_p, internal_post);
> Index: trunk/gcc/config/i386/i386.c
> ===================================================================
> *** trunk.orig/gcc/config/i386/i386.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/i386/i386.c	2011-07-11 17:44:25.000000000 +0200
> *************** ix86_va_start (tree valist, rtx nextarg)
> *** 7559,7566 ****
>       ovf_rtx = cfun->machine->split_stack_varargs_pointer;
>     t = make_tree (type, ovf_rtx);
>     if (words != 0)
> !     t = build2 (POINTER_PLUS_EXPR, type, t,
> ! 	        size_int (words * UNITS_PER_WORD));
>     t = build2 (MODIFY_EXPR, type, ovf, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 7559,7565 ----
>       ovf_rtx = cfun->machine->split_stack_varargs_pointer;
>     t = make_tree (type, ovf_rtx);
>     if (words != 0)
> !     t = fold_build_pointer_plus_hwi (t, words * UNITS_PER_WORD);
>     t = build2 (MODIFY_EXPR, type, ovf, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** ix86_va_start (tree valist, rtx nextarg)
> *** 7572,7579 ****
>         type = TREE_TYPE (sav);
>         t = make_tree (type, frame_pointer_rtx);
>         if (!ix86_varargs_gpr_size)
> ! 	t = build2 (POINTER_PLUS_EXPR, type, t,
> ! 		    size_int (-8 * X86_64_REGPARM_MAX));
>         t = build2 (MODIFY_EXPR, type, sav, t);
>         TREE_SIDE_EFFECTS (t) = 1;
>         expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 7571,7577 ----
>         type = TREE_TYPE (sav);
>         t = make_tree (type, frame_pointer_rtx);
>         if (!ix86_varargs_gpr_size)
> ! 	t = fold_build_pointer_plus_hwi (t, -8 * X86_64_REGPARM_MAX);
>         t = build2 (MODIFY_EXPR, type, sav, t);
>         TREE_SIDE_EFFECTS (t) = 1;
>         expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** ix86_gimplify_va_arg (tree valist, tree
> *** 7729,7743 ****
>         if (needed_intregs)
>   	{
>   	  /* int_addr = gpr + sav; */
> ! 	  t = fold_convert (sizetype, gpr);
> ! 	  t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, t);
>   	  gimplify_assign (int_addr, t, pre_p);
>   	}
>         if (needed_sseregs)
>   	{
>   	  /* sse_addr = fpr + sav; */
> ! 	  t = fold_convert (sizetype, fpr);
> ! 	  t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, t);
>   	  gimplify_assign (sse_addr, t, pre_p);
>   	}
>         if (need_temp)
> --- 7727,7739 ----
>         if (needed_intregs)
>   	{
>   	  /* int_addr = gpr + sav; */
> ! 	  t = fold_build_pointer_plus (sav, gpr);
>   	  gimplify_assign (int_addr, t, pre_p);
>   	}
>         if (needed_sseregs)
>   	{
>   	  /* sse_addr = fpr + sav; */
> ! 	  t = fold_build_pointer_plus (sav, fpr);
>   	  gimplify_assign (sse_addr, t, pre_p);
>   	}
>         if (need_temp)
> *************** ix86_gimplify_va_arg (tree valist, tree
> *** 7791,7802 ****
>   		  src_offset = REGNO (reg) * 8;
>   		}
>   	      src_addr = fold_convert (addr_type, src_addr);
> ! 	      src_addr = fold_build2 (POINTER_PLUS_EXPR, addr_type, src_addr,
> ! 				      size_int (src_offset));
>   
>   	      dest_addr = fold_convert (daddr_type, addr);
> ! 	      dest_addr = fold_build2 (POINTER_PLUS_EXPR, daddr_type, dest_addr,
> ! 				       size_int (prev_size));
>   	      if (cur_size == GET_MODE_SIZE (mode))
>   		{
>   		  src = build_va_arg_indirect_ref (src_addr);
> --- 7787,7796 ----
>   		  src_offset = REGNO (reg) * 8;
>   		}
>   	      src_addr = fold_convert (addr_type, src_addr);
> ! 	      src_addr = fold_build_pointer_plus_hwi (src_addr, src_offset);
>   
>   	      dest_addr = fold_convert (daddr_type, addr);
> ! 	      dest_addr = fold_build_pointer_plus_hwi (dest_addr, prev_size);
>   	      if (cur_size == GET_MODE_SIZE (mode))
>   		{
>   		  src = build_va_arg_indirect_ref (src_addr);
> *************** ix86_gimplify_va_arg (tree valist, tree
> *** 7851,7869 ****
>    else
>       {
>         HOST_WIDE_INT align = arg_boundary / 8;
> !       t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf), ovf,
> ! 		  size_int (align - 1));
> !       t = fold_convert (sizetype, t);
>         t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
> ! 		  size_int (-align));
> !       t = fold_convert (TREE_TYPE (ovf), t);
>       }
>   
>     gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
>     gimplify_assign (addr, t, pre_p);
>   
> !   t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t,
> ! 	      size_int (rsize * UNITS_PER_WORD));
>     gimplify_assign (unshare_expr (ovf), t, pre_p);
>   
>     if (container)
> --- 7845,7859 ----
>    else
>       {
>         HOST_WIDE_INT align = arg_boundary / 8;
> !       t = fold_build_pointer_plus_hwi (ovf, align - 1);
>         t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
> ! 		  build_int_cst (TREE_TYPE (t), -align));
>       }
>   
>     gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
>     gimplify_assign (addr, t, pre_p);
>   
> !   t = fold_build_pointer_plus_hwi (t, rsize * UNITS_PER_WORD);
>     gimplify_assign (unshare_expr (ovf), t, pre_p);
>   
>     if (container)
> Index: trunk/gcc/config/ia64/ia64.c
> ===================================================================
> *** trunk.orig/gcc/config/ia64/ia64.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/ia64/ia64.c	2011-07-11 17:13:24.000000000 +0200
> *************** ia64_gimplify_va_arg (tree valist, tree
> *** 4738,4749 ****
>     if ((TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == INTEGER_TYPE)
>         ? int_size_in_bytes (type) > 8 : TYPE_ALIGN (type) > 8 * BITS_PER_UNIT)
>       {
> !       tree t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (valist), valist,
> ! 		       size_int (2 * UNITS_PER_WORD - 1));
> !       t = fold_convert (sizetype, t);
>         t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
> ! 		  size_int (-2 * UNITS_PER_WORD));
> !       t = fold_convert (TREE_TYPE (valist), t);
>         gimplify_assign (unshare_expr (valist), t, pre_p);
>       }
>   
> --- 4738,4746 ----
>     if ((TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == INTEGER_TYPE)
>         ? int_size_in_bytes (type) > 8 : TYPE_ALIGN (type) > 8 * BITS_PER_UNIT)
>       {
> !       tree t = fold_build_pointer_plus_hwi (valist, 2 * UNITS_PER_WORD - 1);
>         t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
> ! 		  build_int_cst (TREE_TYPE (t), -2 * UNITS_PER_WORD));
>         gimplify_assign (unshare_expr (valist), t, pre_p);
>       }
>   
> Index: trunk/gcc/config/mep/mep.c
> ===================================================================
> *** trunk.orig/gcc/config/mep/mep.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/mep/mep.c	2011-07-11 17:13:24.000000000 +0200
> *************** mep_expand_va_start (tree valist, rtx ne
> *** 3620,3633 ****
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
>   
>     /* va_list.next_gp_limit = va_list.next_gp + 4 * ns; */
> !   u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
> ! 		   size_int (4 * ns));
>     t = build2 (MODIFY_EXPR, ptr_type_node, next_gp_limit, u);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
>   
> !   u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
> ! 		   size_int (8 * ((ns+1)/2)));
>     /* va_list.next_cop = ROUND_UP(va_list.next_gp_limit,8); */
>     t = build2 (MODIFY_EXPR, ptr_type_node, next_cop, u);
>     TREE_SIDE_EFFECTS (t) = 1;
> --- 3620,3631 ----
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
>   
>     /* va_list.next_gp_limit = va_list.next_gp + 4 * ns; */
> !   u = fold_build_pointer_plus_hwi (u, 4 * ns);
>     t = build2 (MODIFY_EXPR, ptr_type_node, next_gp_limit, u);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
>   
> !   u = fold_build_pointer_plus_hwi (u, 8 * ((ns+1)/2));
>     /* va_list.next_cop = ROUND_UP(va_list.next_gp_limit,8); */
>     t = build2 (MODIFY_EXPR, ptr_type_node, next_cop, u);
>     TREE_SIDE_EFFECTS (t) = 1;
> *************** mep_gimplify_va_arg_expr (tree valist, t
> *** 3715,3726 ****
>         gimplify_and_add (tmp, pre_p);
>       }
>   
> !   tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
> ! 		unshare_expr (next_gp), size_int (4));
>     gimplify_assign (unshare_expr (next_gp), tmp, pre_p);
>   
> !   tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
> ! 		unshare_expr (next_cop), size_int (8));
>     gimplify_assign (unshare_expr (next_cop), tmp, pre_p);
>   
>     tmp = build1 (GOTO_EXPR, void_type_node, unshare_expr (label_sover));
> --- 3713,3722 ----
>         gimplify_and_add (tmp, pre_p);
>       }
>   
> !   tmp = fold_build_pointer_plus_hwi (unshare_expr (next_gp), 4);
>     gimplify_assign (unshare_expr (next_gp), tmp, pre_p);
>   
> !   tmp = fold_build_pointer_plus_hwi (unshare_expr (next_cop), 8);
>     gimplify_assign (unshare_expr (next_cop), tmp, pre_p);
>   
>     tmp = build1 (GOTO_EXPR, void_type_node, unshare_expr (label_sover));
> *************** mep_gimplify_va_arg_expr (tree valist, t
> *** 3734,3741 ****
>     tmp = build2 (MODIFY_EXPR, void_type_node, res_addr, unshare_expr (next_stack));
>     gimplify_and_add (tmp, pre_p);
>   
> !   tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
> ! 		unshare_expr (next_stack), size_int (rsize));
>     gimplify_assign (unshare_expr (next_stack), tmp, pre_p);
>   
>     /* - - */
> --- 3730,3736 ----
>     tmp = build2 (MODIFY_EXPR, void_type_node, res_addr, unshare_expr (next_stack));
>     gimplify_and_add (tmp, pre_p);
>   
> !   tmp = fold_build_pointer_plus_hwi (unshare_expr (next_stack), rsize);
>     gimplify_assign (unshare_expr (next_stack), tmp, pre_p);
>   
>     /* - - */
> Index: trunk/gcc/config/mips/mips.c
> ===================================================================
> *** trunk.orig/gcc/config/mips/mips.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/mips/mips.c	2011-07-11 17:13:24.000000000 +0200
> *************** mips_va_start (tree valist, rtx nextarg)
> *** 5452,5459 ****
>   	 words used by named arguments.  */
>         t = make_tree (TREE_TYPE (ovfl), virtual_incoming_args_rtx);
>         if (cum->stack_words > 0)
> ! 	t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovfl), t,
> ! 		    size_int (cum->stack_words * UNITS_PER_WORD));
>         t = build2 (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t);
>         expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
>   
> --- 5452,5458 ----
>   	 words used by named arguments.  */
>         t = make_tree (TREE_TYPE (ovfl), virtual_incoming_args_rtx);
>         if (cum->stack_words > 0)
> ! 	t = fold_build_pointer_plus_hwi (t, cum->stack_words * UNITS_PER_WORD);
>         t = build2 (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t);
>         expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
>   
> *************** mips_va_start (tree valist, rtx nextarg)
> *** 5469,5476 ****
>         fpr_offset = gpr_save_area_size + UNITS_PER_FPVALUE - 1;
>         fpr_offset &= -UNITS_PER_FPVALUE;
>         if (fpr_offset)
> ! 	t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ftop), t,
> ! 		    size_int (-fpr_offset));
>         t = build2 (MODIFY_EXPR, TREE_TYPE (ftop), ftop, t);
>         expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
>   
> --- 5468,5474 ----
>         fpr_offset = gpr_save_area_size + UNITS_PER_FPVALUE - 1;
>         fpr_offset &= -UNITS_PER_FPVALUE;
>         if (fpr_offset)
> ! 	t = fold_build_pointer_plus_hwi (t, -fpr_offset);
>         t = build2 (MODIFY_EXPR, TREE_TYPE (ftop), ftop, t);
>         expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
>   
> *************** mips_gimplify_va_arg_expr (tree valist,
> *** 5615,5638 ****
>   	 addr_rtx = top - off + (BYTES_BIG_ENDIAN ? RSIZE - SIZE : 0).  */
>         t = fold_convert (sizetype, t);
>         t = fold_build1 (NEGATE_EXPR, sizetype, t);
> !       t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (top), top, t);
>         if (BYTES_BIG_ENDIAN && rsize > size)
> ! 	{
> ! 	  u = size_int (rsize - size);
> ! 	  t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, u);
> ! 	}
>         COND_EXPR_THEN (addr) = t;
>   
>         if (osize > UNITS_PER_WORD)
>   	{
>   	  /* [9] Emit: ovfl = ((intptr_t) ovfl + osize - 1) & -osize.  */
> ! 	  u = size_int (osize - 1);
> ! 	  t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovfl),
> ! 		      unshare_expr (ovfl), u);
> ! 	  t = fold_convert (sizetype, t);
> ! 	  u = size_int (-osize);
>   	  t = build2 (BIT_AND_EXPR, sizetype, t, u);
> - 	  t = fold_convert (TREE_TYPE (ovfl), t);
>   	  align = build2 (MODIFY_EXPR, TREE_TYPE (ovfl),
>   			  unshare_expr (ovfl), t);
>   	}
> --- 5613,5629 ----
>   	 addr_rtx = top - off + (BYTES_BIG_ENDIAN ? RSIZE - SIZE : 0).  */
>         t = fold_convert (sizetype, t);
>         t = fold_build1 (NEGATE_EXPR, sizetype, t);
> !       t = fold_build_pointer_plus (top, t);
>         if (BYTES_BIG_ENDIAN && rsize > size)
> ! 	t = fold_build_pointer_plus_hwi (t, rsize - size);
>         COND_EXPR_THEN (addr) = t;
>   
>         if (osize > UNITS_PER_WORD)
>   	{
>   	  /* [9] Emit: ovfl = ((intptr_t) ovfl + osize - 1) & -osize.  */
> ! 	  t = fold_build_pointer_plus_hwi (unshare_expr (ovfl), osize - 1);
> ! 	  u = build_int_cst (TREE_TYPE (t), -osize);
>   	  t = build2 (BIT_AND_EXPR, sizetype, t, u);
>   	  align = build2 (MODIFY_EXPR, TREE_TYPE (ovfl),
>   			  unshare_expr (ovfl), t);
>   	}
> *************** mips_gimplify_va_arg_expr (tree valist,
> *** 5645,5654 ****
>         u = fold_convert (TREE_TYPE (ovfl), build_int_cst (NULL_TREE, osize));
>         t = build2 (POSTINCREMENT_EXPR, TREE_TYPE (ovfl), ovfl, u);
>         if (BYTES_BIG_ENDIAN && osize > size)
> ! 	{
> ! 	  u = size_int (osize - size);
> ! 	  t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, u);
> ! 	}
>   
>         /* String [9] and [10, 11] together.  */
>         if (align)
> --- 5636,5642 ----
>         u = fold_convert (TREE_TYPE (ovfl), build_int_cst (NULL_TREE, osize));
>         t = build2 (POSTINCREMENT_EXPR, TREE_TYPE (ovfl), ovfl, u);
>         if (BYTES_BIG_ENDIAN && osize > size)
> ! 	t = fold_build_pointer_plus_hwi (t, osize - size);
>   
>         /* String [9] and [10, 11] together.  */
>         if (align)
> Index: trunk/gcc/config/pa/pa.c
> ===================================================================
> *** trunk.orig/gcc/config/pa/pa.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/pa/pa.c	2011-07-11 17:13:24.000000000 +0200
> *************** hppa_gimplify_va_arg_expr (tree valist,
> *** 6112,6118 ****
>   
>         u = fold_convert (sizetype, size_in_bytes (type));
>         u = fold_build1 (NEGATE_EXPR, sizetype, u);
> !       t = build2 (POINTER_PLUS_EXPR, valist_type, valist, u);
>   
>         /* Align to 4 or 8 byte boundary depending on argument size.  */
>   
> --- 6112,6118 ----
>   
>         u = fold_convert (sizetype, size_in_bytes (type));
>         u = fold_build1 (NEGATE_EXPR, sizetype, u);
> !       t = fold_build_pointer_plus (valist, u);
>   
>         /* Align to 4 or 8 byte boundary depending on argument size.  */
>   
> *************** hppa_gimplify_va_arg_expr (tree valist,
> *** 6124,6133 ****
>   
>         ofs = (8 - size) % 4;
>         if (ofs != 0)
> ! 	{
> ! 	  u = size_int (ofs);
> ! 	  t = build2 (POINTER_PLUS_EXPR, valist_type, t, u);
> ! 	}
>   
>         t = fold_convert (ptr, t);
>         t = build_va_arg_indirect_ref (t);
> --- 6124,6130 ----
>   
>         ofs = (8 - size) % 4;
>         if (ofs != 0)
> ! 	t = fold_build_pointer_plus_hwi (t, ofs);
>   
>         t = fold_convert (ptr, t);
>         t = build_va_arg_indirect_ref (t);
> Index: trunk/gcc/config/rs6000/rs6000.c
> ===================================================================
> *** trunk.orig/gcc/config/rs6000/rs6000.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/rs6000/rs6000.c	2011-07-11 17:13:24.000000000 +0200
> *************** rs6000_va_start (tree valist, rtx nextar
> *** 9131,9138 ****
>     /* Find the overflow area.  */
>     t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx);
>     if (words != 0)
> !     t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf), t,
> ! 	        size_int (words * UNITS_PER_WORD));
>     t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 9131,9137 ----
>     /* Find the overflow area.  */
>     t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx);
>     if (words != 0)
> !     t = fold_build_pointer_plus_hwi (t, words * UNITS_PER_WORD);
>     t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** rs6000_va_start (tree valist, rtx nextar
> *** 9148,9155 ****
>     /* Find the register save area.  */
>     t = make_tree (TREE_TYPE (sav), virtual_stack_vars_rtx);
>     if (cfun->machine->varargs_save_offset)
> !     t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (sav), t,
> ! 	        size_int (cfun->machine->varargs_save_offset));
>     t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 9147,9153 ----
>     /* Find the register save area.  */
>     t = make_tree (TREE_TYPE (sav), virtual_stack_vars_rtx);
>     if (cfun->machine->varargs_save_offset)
> !     t = fold_build_pointer_plus_hwi (t, cfun->machine->varargs_save_offset);
>     t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** rs6000_gimplify_va_arg (tree valist, tre
> *** 9202,9210 ****
>   	  /* This updates arg ptr by the amount that would be necessary
>   	     to align the zero-sized (but not zero-alignment) item.  */
>   	  t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
> ! 		  fold_build2 (POINTER_PLUS_EXPR,
> ! 			       TREE_TYPE (valist),
> ! 			       valist_tmp, size_int (boundary - 1)));
>   	  gimplify_and_add (t, pre_p);
>   
>   	  t = fold_convert (sizetype, valist_tmp);
> --- 9200,9206 ----
>   	  /* This updates arg ptr by the amount that would be necessary
>   	     to align the zero-sized (but not zero-alignment) item.  */
>   	  t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
> ! 		      fold_build_pointer_plus_hwi (valist_tmp, boundary - 1));
>   	  gimplify_and_add (t, pre_p);
>   
>   	  t = fold_convert (sizetype, valist_tmp);
> *************** rs6000_gimplify_va_arg (tree valist, tre
> *** 9339,9358 ****
>   
>         t = sav;
>         if (sav_ofs)
> ! 	t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, size_int (sav_ofs));
>   
>         u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), unshare_expr (reg),
>   		  build_int_cst (TREE_TYPE (reg), n_reg));
>         u = fold_convert (sizetype, u);
>         u = build2 (MULT_EXPR, sizetype, u, size_int (sav_scale));
> !       t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t, u);
>   
>         /* _Decimal32 varargs are located in the second word of the 64-bit
>   	 FP register for 32-bit binaries.  */
>         if (!TARGET_POWERPC64
>   	  && TARGET_HARD_FLOAT && TARGET_FPRS
>   	  && TYPE_MODE (type) == SDmode)
> ! 	t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, size_int (size));
>   
>         gimplify_assign (addr, t, pre_p);
>   
> --- 9335,9354 ----
>   
>         t = sav;
>         if (sav_ofs)
> ! 	t = fold_build_pointer_plus_hwi (sav, sav_ofs);
>   
>         u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), unshare_expr (reg),
>   		  build_int_cst (TREE_TYPE (reg), n_reg));
>         u = fold_convert (sizetype, u);
>         u = build2 (MULT_EXPR, sizetype, u, size_int (sav_scale));
> !       t = fold_build_pointer_plus (t, u);
>   
>         /* _Decimal32 varargs are located in the second word of the 64-bit
>   	 FP register for 32-bit binaries.  */
>         if (!TARGET_POWERPC64
>   	  && TARGET_HARD_FLOAT && TARGET_FPRS
>   	  && TYPE_MODE (type) == SDmode)
> ! 	t = fold_build_pointer_plus_hwi (t, size);
>   
>         gimplify_assign (addr, t, pre_p);
>   
> *************** rs6000_gimplify_va_arg (tree valist, tre
> *** 9375,9391 ****
>     t = ovf;
>     if (align != 1)
>       {
> !       t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, size_int (align - 1));
> !       t = fold_convert (sizetype, t);
>         t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
> ! 		  size_int (-align));
> !       t = fold_convert (TREE_TYPE (ovf), t);
>       }
>     gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
>   
>     gimplify_assign (unshare_expr (addr), t, pre_p);
>   
> !   t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, size_int (size));
>     gimplify_assign (unshare_expr (ovf), t, pre_p);
>   
>     if (lab_over)
> --- 9371,9385 ----
>     t = ovf;
>     if (align != 1)
>       {
> !       t = fold_build_pointer_plus_hwi (t, align - 1);
>         t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
> ! 		  build_int_cst (TREE_TYPE (t), -align));
>       }
>     gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
>   
>     gimplify_assign (unshare_expr (addr), t, pre_p);
>   
> !   t = fold_build_pointer_plus_hwi (t, size);
>     gimplify_assign (unshare_expr (ovf), t, pre_p);
>   
>     if (lab_over)
> Index: trunk/gcc/config/s390/s390.c
> ===================================================================
> *** trunk.orig/gcc/config/s390/s390.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/s390/s390.c	2011-07-11 17:13:24.000000000 +0200
> *************** s390_va_start (tree valist, rtx nextarg
> *** 8868,8874 ****
>   	fprintf (stderr, "va_start: n_gpr = %d, n_fpr = %d off %d\n",
>   		 (int)n_gpr, (int)n_fpr, off);
>   
> !       t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf), t, size_int (off));
>   
>         t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
>         TREE_SIDE_EFFECTS (t) = 1;
> --- 8868,8874 ----
>   	fprintf (stderr, "va_start: n_gpr = %d, n_fpr = %d off %d\n",
>   		 (int)n_gpr, (int)n_fpr, off);
>   
> !       t = fold_build_pointer_plus_hwi (t, off);
>   
>         t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
>         TREE_SIDE_EFFECTS (t) = 1;
> *************** s390_va_start (tree valist, rtx nextarg
> *** 8880,8887 ****
>         || (cfun->va_list_fpr_size && n_fpr < FP_ARG_NUM_REG))
>       {
>         t = make_tree (TREE_TYPE (sav), return_address_pointer_rtx);
> !       t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (sav), t,
> ! 	          size_int (-RETURN_REGNUM * UNITS_PER_LONG));
>   
>         t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
>         TREE_SIDE_EFFECTS (t) = 1;
> --- 8880,8886 ----
>         || (cfun->va_list_fpr_size && n_fpr < FP_ARG_NUM_REG))
>       {
>         t = make_tree (TREE_TYPE (sav), return_address_pointer_rtx);
> !       t = fold_build_pointer_plus_hwi (t, -RETURN_REGNUM * UNITS_PER_LONG);
>   
>         t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
>         TREE_SIDE_EFFECTS (t) = 1;
> *************** s390_gimplify_va_arg (tree valist, tree
> *** 9013,9023 ****
>     t = build3 (COND_EXPR, void_type_node, t, u, NULL_TREE);
>     gimplify_and_add (t, pre_p);
>   
> !   t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav,
> ! 	      size_int (sav_ofs));
>     u = build2 (MULT_EXPR, TREE_TYPE (reg), reg,
>   	      fold_convert (TREE_TYPE (reg), size_int (sav_scale)));
> !   t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t, fold_convert (sizetype, u));
>   
>     gimplify_assign (addr, t, pre_p);
>   
> --- 9012,9021 ----
>     t = build3 (COND_EXPR, void_type_node, t, u, NULL_TREE);
>     gimplify_and_add (t, pre_p);
>   
> !   t = fold_build_pointer_plus_hwi (sav, sav_ofs);
>     u = build2 (MULT_EXPR, TREE_TYPE (reg), reg,
>   	      fold_convert (TREE_TYPE (reg), size_int (sav_scale)));
> !   t = fold_build_pointer_plus (t, u);
>   
>     gimplify_assign (addr, t, pre_p);
>   
> *************** s390_gimplify_va_arg (tree valist, tree
> *** 9030,9044 ****
>   
>     t = ovf;
>     if (size < UNITS_PER_LONG)
> !     t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
> ! 		size_int (UNITS_PER_LONG - size));
>   
>     gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
>   
>     gimplify_assign (addr, t, pre_p);
>   
> !   t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
> ! 	      size_int (size));
>     gimplify_assign (ovf, t, pre_p);
>   
>     gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over));
> --- 9028,9040 ----
>   
>     t = ovf;
>     if (size < UNITS_PER_LONG)
> !     t = fold_build_pointer_plus_hwi (t, UNITS_PER_LONG - size);
>   
>     gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
>   
>     gimplify_assign (addr, t, pre_p);
>   
> !   t = fold_build_pointer_plus_hwi (t, size);
>     gimplify_assign (ovf, t, pre_p);
>   
>     gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over));
> Index: trunk/gcc/config/sh/sh.c
> ===================================================================
> *** trunk.orig/gcc/config/sh/sh.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/sh/sh.c	2011-07-11 17:13:24.000000000 +0200
> *************** sh_va_start (tree valist, rtx nextarg)
> *** 7831,7838 ****
>       nfp = 8 - nfp;
>     else
>       nfp = 0;
> !   u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
> ! 		   size_int (UNITS_PER_WORD * nfp));
>     t = build2 (MODIFY_EXPR, ptr_type_node, next_fp_limit, u);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 7831,7837 ----
>       nfp = 8 - nfp;
>     else
>       nfp = 0;
> !   u = fold_build_pointer_plus_hwi (u, UNITS_PER_WORD * nfp);
>     t = build2 (MODIFY_EXPR, ptr_type_node, next_fp_limit, u);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** sh_va_start (tree valist, rtx nextarg)
> *** 7846,7853 ****
>       nint = 4 - nint;
>     else
>       nint = 0;
> !   u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
> ! 		   size_int (UNITS_PER_WORD * nint));
>     t = build2 (MODIFY_EXPR, ptr_type_node, next_o_limit, u);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 7845,7851 ----
>       nint = 4 - nint;
>     else
>       nint = 0;
> !   u = fold_build_pointer_plus_hwi (u, UNITS_PER_WORD * nint);
>     t = build2 (MODIFY_EXPR, ptr_type_node, next_o_limit, u);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** sh_gimplify_va_arg_expr (tree valist, tr
> *** 7983,7990 ****
>   	  gimplify_assign (unshare_expr (next_fp_tmp), valist, pre_p);
>   	  tmp = next_fp_limit;
>   	  if (size > 4 && !is_double)
> ! 	    tmp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (tmp),
> ! 			  unshare_expr (tmp), size_int (4 - size));
>   	  tmp = build2 (GE_EXPR, boolean_type_node,
>   			unshare_expr (next_fp_tmp), unshare_expr (tmp));
>   	  cmp = build3 (COND_EXPR, void_type_node, tmp,
> --- 7981,7987 ----
>   	  gimplify_assign (unshare_expr (next_fp_tmp), valist, pre_p);
>   	  tmp = next_fp_limit;
>   	  if (size > 4 && !is_double)
> ! 	    tmp = fold_build_pointer_plus_hwi (unshare_expr (tmp), 4 - size);
>   	  tmp = build2 (GE_EXPR, boolean_type_node,
>   			unshare_expr (next_fp_tmp), unshare_expr (tmp));
>   	  cmp = build3 (COND_EXPR, void_type_node, tmp,
> *************** sh_gimplify_va_arg_expr (tree valist, tr
> *** 7999,8006 ****
>   	      tmp = fold_convert (sizetype, next_fp_tmp);
>   	      tmp = build2 (BIT_AND_EXPR, sizetype, tmp,
>   			    size_int (UNITS_PER_WORD));
> ! 	      tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
> ! 			    unshare_expr (next_fp_tmp), tmp);
>   	      gimplify_assign (unshare_expr (next_fp_tmp), tmp, pre_p);
>   	    }
>   	  if (is_double)
> --- 7996,8002 ----
>   	      tmp = fold_convert (sizetype, next_fp_tmp);
>   	      tmp = build2 (BIT_AND_EXPR, sizetype, tmp,
>   			    size_int (UNITS_PER_WORD));
> ! 	      tmp = fold_build_pointer_plus (unshare_expr (next_fp_tmp), tmp);
>   	      gimplify_assign (unshare_expr (next_fp_tmp), tmp, pre_p);
>   	    }
>   	  if (is_double)
> *************** sh_gimplify_va_arg_expr (tree valist, tr
> *** 8045,8052 ****
>   	}
>         else
>   	{
> ! 	  tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
> ! 			unshare_expr (next_o), size_int (rsize));
>   	  tmp = build2 (GT_EXPR, boolean_type_node, tmp,
>   			unshare_expr (next_o_limit));
>   	  tmp = build3 (COND_EXPR, void_type_node, tmp,
> --- 8041,8047 ----
>   	}
>         else
>   	{
> ! 	  tmp = fold_build_pointer_plus_hwi (unshare_expr (next_o), rsize);
>   	  tmp = build2 (GT_EXPR, boolean_type_node, tmp,
>   			unshare_expr (next_o_limit));
>   	  tmp = build3 (COND_EXPR, void_type_node, tmp,
> Index: trunk/gcc/config/sparc/sparc.c
> ===================================================================
> *** trunk.orig/gcc/config/sparc/sparc.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/sparc/sparc.c	2011-07-11 17:13:24.000000000 +0200
> *************** sparc_gimplify_va_arg (tree valist, tree
> *** 6677,6684 ****
>     incr = valist;
>     if (align)
>       {
> !       incr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, incr,
> ! 			  size_int (align - 1));
>         incr = fold_convert (sizetype, incr);
>         incr = fold_build2 (BIT_AND_EXPR, sizetype, incr,
>   			  size_int (-align));
> --- 6677,6683 ----
>     incr = valist;
>     if (align)
>       {
> !       incr = fold_build_pointer_plus_hwi (incr, align - 1);
>         incr = fold_convert (sizetype, incr);
>         incr = fold_build2 (BIT_AND_EXPR, sizetype, incr,
>   			  size_int (-align));
> *************** sparc_gimplify_va_arg (tree valist, tree
> *** 6689,6696 ****
>     addr = incr;
>   
>     if (BYTES_BIG_ENDIAN && size < rsize)
> !     addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, incr,
> ! 			size_int (rsize - size));
>   
>     if (indirect)
>       {
> --- 6688,6694 ----
>     addr = incr;
>   
>     if (BYTES_BIG_ENDIAN && size < rsize)
> !     addr = fold_build_pointer_plus_hwi (incr, rsize - size);
>   
>     if (indirect)
>       {
> *************** sparc_gimplify_va_arg (tree valist, tree
> *** 6714,6721 ****
>     else
>       addr = fold_convert (ptrtype, addr);
>   
> !   incr
> !     = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, incr, size_int (rsize));
>     gimplify_assign (valist, incr, post_p);
>   
>     return build_va_arg_indirect_ref (addr);
> --- 6712,6718 ----
>     else
>       addr = fold_convert (ptrtype, addr);
>   
> !   incr = fold_build_pointer_plus_hwi (incr, rsize);
>     gimplify_assign (valist, incr, post_p);
>   
>     return build_va_arg_indirect_ref (addr);
> Index: trunk/gcc/config/spu/spu.c
> ===================================================================
> *** trunk.orig/gcc/config/spu/spu.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/spu/spu.c	2011-07-11 17:13:24.000000000 +0200
> *************** spu_va_start (tree valist, rtx nextarg)
> *** 4183,4199 ****
>     /* Find the __args area.  */
>     t = make_tree (TREE_TYPE (args), nextarg);
>     if (crtl->args.pretend_args_size > 0)
> !     t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (args), t,
> ! 		size_int (-STACK_POINTER_OFFSET));
>     t = build2 (MODIFY_EXPR, TREE_TYPE (args), args, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
>   
>     /* Find the __skip area.  */
>     t = make_tree (TREE_TYPE (skip), virtual_incoming_args_rtx);
> !   t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (skip), t,
> ! 	      size_int (crtl->args.pretend_args_size
> ! 			 - STACK_POINTER_OFFSET));
>     t = build2 (MODIFY_EXPR, TREE_TYPE (skip), skip, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 4183,4197 ----
>     /* Find the __args area.  */
>     t = make_tree (TREE_TYPE (args), nextarg);
>     if (crtl->args.pretend_args_size > 0)
> !     t = fold_build_pointer_plus_hwi (t, -STACK_POINTER_OFFSET);
>     t = build2 (MODIFY_EXPR, TREE_TYPE (args), args, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
>   
>     /* Find the __skip area.  */
>     t = make_tree (TREE_TYPE (skip), virtual_incoming_args_rtx);
> !   t = fold_build_pointer_plus_hwi (t, (crtl->args.pretend_args_size
> ! 				       - STACK_POINTER_OFFSET));
>     t = build2 (MODIFY_EXPR, TREE_TYPE (skip), skip, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** spu_gimplify_va_arg_expr (tree valist, t
> *** 4223,4229 ****
>     tree f_args, f_skip;
>     tree args, skip;
>     HOST_WIDE_INT size, rsize;
> !   tree paddedsize, addr, tmp;
>     bool pass_by_reference_p;
>   
>     f_args = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
> --- 4221,4227 ----
>     tree f_args, f_skip;
>     tree args, skip;
>     HOST_WIDE_INT size, rsize;
> !   tree addr, tmp;
>     bool pass_by_reference_p;
>   
>     f_args = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
> *************** spu_gimplify_va_arg_expr (tree valist, t
> *** 4248,4268 ****
>   
>     /* build conditional expression to calculate addr. The expression
>        will be gimplified later. */
> !   paddedsize = size_int (rsize);
> !   tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, unshare_expr (args), paddedsize);
>     tmp = build2 (TRUTH_AND_EXPR, boolean_type_node,
>   		build2 (GT_EXPR, boolean_type_node, tmp, unshare_expr (skip)),
>   		build2 (LE_EXPR, boolean_type_node, unshare_expr (args),
>   		unshare_expr (skip)));
>   
>     tmp = build3 (COND_EXPR, ptr_type_node, tmp,
> ! 		build2 (POINTER_PLUS_EXPR, ptr_type_node, unshare_expr (skip),
> ! 			size_int (32)), unshare_expr (args));
>   
>     gimplify_assign (addr, tmp, pre_p);
>   
>     /* update VALIST.__args */
> !   tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, addr, paddedsize);
>     gimplify_assign (unshare_expr (args), tmp, pre_p);
>   
>     addr = fold_convert (build_pointer_type_for_mode (type, ptr_mode, true),
> --- 4246,4265 ----
>   
>     /* build conditional expression to calculate addr. The expression
>        will be gimplified later. */
> !   tmp = fold_build_pointer_plus_hwi (unshare_expr (args), rsize);
>     tmp = build2 (TRUTH_AND_EXPR, boolean_type_node,
>   		build2 (GT_EXPR, boolean_type_node, tmp, unshare_expr (skip)),
>   		build2 (LE_EXPR, boolean_type_node, unshare_expr (args),
>   		unshare_expr (skip)));
>   
>     tmp = build3 (COND_EXPR, ptr_type_node, tmp,
> ! 		fold_build_pointer_plus_hwi (unshare_expr (skip), 32),
> ! 		unshare_expr (args));
>   
>     gimplify_assign (addr, tmp, pre_p);
>   
>     /* update VALIST.__args */
> !   tmp = fold_build_pointer_plus_hwi (addr, rsize);
>     gimplify_assign (unshare_expr (args), tmp, pre_p);
>   
>     addr = fold_convert (build_pointer_type_for_mode (type, ptr_mode, true),
> Index: trunk/gcc/config/stormy16/stormy16.c
> ===================================================================
> *** trunk.orig/gcc/config/stormy16/stormy16.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/stormy16/stormy16.c	2011-07-11 17:13:24.000000000 +0200
> *************** xstormy16_expand_builtin_va_start (tree
> *** 1292,1298 ****
>     t = make_tree (TREE_TYPE (base), virtual_incoming_args_rtx);
>     u = build_int_cst (NULL_TREE, - INCOMING_FRAME_SP_OFFSET);
>     u = fold_convert (TREE_TYPE (count), u);
> !   t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (base), t, u);
>     t = build2 (MODIFY_EXPR, TREE_TYPE (base), base, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 1292,1298 ----
>     t = make_tree (TREE_TYPE (base), virtual_incoming_args_rtx);
>     u = build_int_cst (NULL_TREE, - INCOMING_FRAME_SP_OFFSET);
>     u = fold_convert (TREE_TYPE (count), u);
> !   t = fold_build_pointer_plus (t, u);
>     t = build2 (MODIFY_EXPR, TREE_TYPE (base), base, t);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** xstormy16_gimplify_va_arg_expr (tree val
> *** 1350,1356 ****
>   		  NULL_TREE);
>         gimplify_and_add (t, pre_p);
>   
> !       t = build2 (POINTER_PLUS_EXPR, ptr_type_node, base, count_tmp);
>         gimplify_assign (addr, t, pre_p);
>   
>         t = build1 (GOTO_EXPR, void_type_node, lab_gotaddr);
> --- 1350,1356 ----
>   		  NULL_TREE);
>         gimplify_and_add (t, pre_p);
>   
> !       t = fold_build_pointer_plus (base, count_tmp);
>         gimplify_assign (addr, t, pre_p);
>   
>         t = build1 (GOTO_EXPR, void_type_node, lab_gotaddr);
> *************** xstormy16_gimplify_va_arg_expr (tree val
> *** 1385,1391 ****
>   	      fold_convert (TREE_TYPE (count), size_tree));
>     t = fold_convert (TREE_TYPE (t), fold (t));
>     t = fold_build1 (NEGATE_EXPR, TREE_TYPE (t), t);
> !   t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (base), base, t);
>     gimplify_assign (addr, t, pre_p);
>   
>     t = build1 (LABEL_EXPR, void_type_node, lab_gotaddr);
> --- 1385,1391 ----
>   	      fold_convert (TREE_TYPE (count), size_tree));
>     t = fold_convert (TREE_TYPE (t), fold (t));
>     t = fold_build1 (NEGATE_EXPR, TREE_TYPE (t), t);
> !   t = fold_build_pointer_plus (base, t);
>     gimplify_assign (addr, t, pre_p);
>   
>     t = build1 (LABEL_EXPR, void_type_node, lab_gotaddr);
> Index: trunk/gcc/config/xtensa/xtensa.c
> ===================================================================
> *** trunk.orig/gcc/config/xtensa/xtensa.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/config/xtensa/xtensa.c	2011-07-11 17:13:24.000000000 +0200
> *************** xtensa_va_start (tree valist, rtx nextar
> *** 2853,2859 ****
>   
>     /* Set the __va_stk member to ($arg_ptr - 32).  */
>     u = make_tree (ptr_type_node, virtual_incoming_args_rtx);
> !   u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u, size_int (-32));
>     t = build2 (MODIFY_EXPR, ptr_type_node, stk, u);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> --- 2853,2859 ----
>   
>     /* Set the __va_stk member to ($arg_ptr - 32).  */
>     u = make_tree (ptr_type_node, virtual_incoming_args_rtx);
> !   u = fold_build_pointer_plus_hwi (u, -32);
>     t = build2 (MODIFY_EXPR, ptr_type_node, stk, u);
>     TREE_SIDE_EFFECTS (t) = 1;
>     expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
> *************** xtensa_gimplify_va_arg_expr (tree valist
> *** 3042,3048 ****
>   
>     t = fold_convert (sizetype, unshare_expr (ndx));
>     t = build2 (MINUS_EXPR, sizetype, t, size);
> !   addr = build2 (POINTER_PLUS_EXPR, ptr_type_node, unshare_expr (array), t);
>   
>     addr = fold_convert (build_pointer_type (type), addr);
>     if (indirect)
> --- 3042,3048 ----
>   
>     t = fold_convert (sizetype, unshare_expr (ndx));
>     t = build2 (MINUS_EXPR, sizetype, t, size);
> !   addr = fold_build_pointer_plus (unshare_expr (array), t);
>   
>     addr = fold_convert (build_pointer_type (type), addr);
>     if (indirect)
> Index: trunk/gcc/cp/call.c
> ===================================================================
> *** trunk.orig/gcc/cp/call.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/cp/call.c	2011-07-11 17:13:24.000000000 +0200
> *************** build_special_member_call (tree instance
> *** 6936,6943 ****
>   		    current_vtt_parm,
>   		    vtt);
>         gcc_assert (BINFO_SUBVTT_INDEX (binfo));
> !       sub_vtt = build2 (POINTER_PLUS_EXPR, TREE_TYPE (vtt), vtt,
> ! 			BINFO_SUBVTT_INDEX (binfo));
>   
>         if (args == NULL)
>   	{
> --- 6936,6942 ----
>   		    current_vtt_parm,
>   		    vtt);
>         gcc_assert (BINFO_SUBVTT_INDEX (binfo));
> !       sub_vtt = fold_build_pointer_plus (vtt, BINFO_SUBVTT_INDEX (binfo));
>   
>         if (args == NULL)
>   	{
> Index: trunk/gcc/cp/class.c
> ===================================================================
> *** trunk.orig/gcc/cp/class.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/cp/class.c	2011-07-11 17:28:24.000000000 +0200
> *************** build_base_path (enum tree_code code,
> *** 374,381 ****
>                                                               tf_warning_or_error),
>   				     TREE_TYPE (TREE_TYPE (expr)));
>   
> !       v_offset = build2 (POINTER_PLUS_EXPR, TREE_TYPE (v_offset),
> ! 			 v_offset, fold_convert (sizetype, BINFO_VPTR_FIELD (v_binfo)));
>         v_offset = build1 (NOP_EXPR,
>   			 build_pointer_type (ptrdiff_type_node),
>   			 v_offset);
> --- 374,380 ----
>                                                               tf_warning_or_error),
>   				     TREE_TYPE (TREE_TYPE (expr)));
>   
> !       v_offset = fold_build_pointer_plus (v_offset, BINFO_VPTR_FIELD (v_binfo));
>         v_offset = build1 (NOP_EXPR,
>   			 build_pointer_type (ptrdiff_type_node),
>   			 v_offset);
> *************** build_base_path (enum tree_code code,
> *** 413,419 ****
>         offset = fold_convert (sizetype, offset);
>         if (code == MINUS_EXPR)
>   	offset = fold_build1_loc (input_location, NEGATE_EXPR, sizetype, offset);
> !       expr = build2 (POINTER_PLUS_EXPR, ptr_target_type, expr, offset);
>       }
>     else
>       null_test = NULL;
> --- 412,418 ----
>         offset = fold_convert (sizetype, offset);
>         if (code == MINUS_EXPR)
>   	offset = fold_build1_loc (input_location, NEGATE_EXPR, sizetype, offset);
> !       expr = fold_build_pointer_plus (expr, offset);
>       }
>     else
>       null_test = NULL;
> *************** convert_to_base_statically (tree expr, t
> *** 540,549 ****
>     expr_type = TREE_TYPE (expr);
>     if (!SAME_BINFO_TYPE_P (BINFO_TYPE (base), expr_type))
>       {
> -       tree pointer_type;
> - 
> -       pointer_type = build_pointer_type (expr_type);
> - 
>         /* We use fold_build2 and fold_convert below to simplify the trees
>   	 provided to the optimizers.  It is not safe to call these functions
>   	 when processing a template because they do not handle C++-specific
> --- 539,544 ----
> *************** convert_to_base_statically (tree expr, t
> *** 551,559 ****
>         gcc_assert (!processing_template_decl);
>         expr = cp_build_addr_expr (expr, tf_warning_or_error);
>         if (!integer_zerop (BINFO_OFFSET (base)))
> !         expr = fold_build2_loc (input_location,
> ! 			    POINTER_PLUS_EXPR, pointer_type, expr,
> ! 			    fold_convert (sizetype, BINFO_OFFSET (base)));
>         expr = fold_convert (build_pointer_type (BINFO_TYPE (base)), expr);
>         expr = build_fold_indirect_ref_loc (input_location, expr);
>       }
> --- 546,553 ----
>         gcc_assert (!processing_template_decl);
>         expr = cp_build_addr_expr (expr, tf_warning_or_error);
>         if (!integer_zerop (BINFO_OFFSET (base)))
> !         expr = fold_build_pointer_plus_loc (input_location,
> ! 					    expr, BINFO_OFFSET (base));
>         expr = fold_convert (build_pointer_type (BINFO_TYPE (base)), expr);
>         expr = build_fold_indirect_ref_loc (input_location, expr);
>       }
> *************** dfs_accumulate_vtbl_inits (tree binfo,
> *** 7833,7845 ****
>   
>         /* Figure out the position to which the VPTR should point.  */
>         vtbl = build1 (ADDR_EXPR, vtbl_ptr_type_node, orig_vtbl);
> -       index = size_binop (PLUS_EXPR,
> - 			  size_int (non_fn_entries),
> - 			  size_int (n_inits));
>         index = size_binop (MULT_EXPR,
>   			  TYPE_SIZE_UNIT (vtable_entry_type),
> ! 			  index);
> !       vtbl = build2 (POINTER_PLUS_EXPR, TREE_TYPE (vtbl), vtbl, index);
>       }
>   
>     if (ctor_vtbl_p)
> --- 7827,7836 ----
>   
>         /* Figure out the position to which the VPTR should point.  */
>         vtbl = build1 (ADDR_EXPR, vtbl_ptr_type_node, orig_vtbl);
>         index = size_binop (MULT_EXPR,
>   			  TYPE_SIZE_UNIT (vtable_entry_type),
> ! 			  size_int (non_fn_entries + n_inits));
> !       vtbl = fold_build_pointer_plus (vtbl, index);
>       }
>   
>     if (ctor_vtbl_p)
> Index: trunk/gcc/cp/cp-gimplify.c
> ===================================================================
> *** trunk.orig/gcc/cp/cp-gimplify.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/cp/cp-gimplify.c	2011-07-11 17:13:24.000000000 +0200
> *************** cxx_omp_clause_apply_fn (tree fn, tree a
> *** 1230,1236 ****
>   	start2 = build_fold_addr_expr_loc (input_location, start2);
>   
>         end1 = TYPE_SIZE_UNIT (TREE_TYPE (arg1));
> !       end1 = build2 (POINTER_PLUS_EXPR, TREE_TYPE (start1), start1, end1);
>   
>         p1 = create_tmp_var (TREE_TYPE (start1), NULL);
>         t = build2 (MODIFY_EXPR, TREE_TYPE (p1), p1, start1);
> --- 1230,1236 ----
>   	start2 = build_fold_addr_expr_loc (input_location, start2);
>   
>         end1 = TYPE_SIZE_UNIT (TREE_TYPE (arg1));
> !       end1 = fold_build_pointer_plus (start1, end1);
>   
>         p1 = create_tmp_var (TREE_TYPE (start1), NULL);
>         t = build2 (MODIFY_EXPR, TREE_TYPE (p1), p1, start1);
> *************** cxx_omp_clause_apply_fn (tree fn, tree a
> *** 1260,1274 ****
>         t = fold_build_cleanup_point_expr (TREE_TYPE (t), t);
>         append_to_statement_list (t, &ret);
>   
> !       t = TYPE_SIZE_UNIT (inner_type);
> !       t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (p1), p1, t);
>         t = build2 (MODIFY_EXPR, TREE_TYPE (p1), p1, t);
>         append_to_statement_list (t, &ret);
>   
>         if (arg2)
>   	{
> ! 	  t = TYPE_SIZE_UNIT (inner_type);
> ! 	  t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (p2), p2, t);
>   	  t = build2 (MODIFY_EXPR, TREE_TYPE (p2), p2, t);
>   	  append_to_statement_list (t, &ret);
>   	}
> --- 1260,1272 ----
>         t = fold_build_cleanup_point_expr (TREE_TYPE (t), t);
>         append_to_statement_list (t, &ret);
>   
> !       t = fold_build_pointer_plus (p1, TYPE_SIZE_UNIT (inner_type));
>         t = build2 (MODIFY_EXPR, TREE_TYPE (p1), p1, t);
>         append_to_statement_list (t, &ret);
>   
>         if (arg2)
>   	{
> ! 	  t = fold_build_pointer_plus (p2, TYPE_SIZE_UNIT (inner_type));
>   	  t = build2 (MODIFY_EXPR, TREE_TYPE (p2), p2, t);
>   	  append_to_statement_list (t, &ret);
>   	}
> Index: trunk/gcc/cp/except.c
> ===================================================================
> *** trunk.orig/gcc/cp/except.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/cp/except.c	2011-07-11 17:13:24.000000000 +0200
> *************** expand_start_catch_block (tree decl)
> *** 452,461 ****
>   	 generic exception header.  */
>         exp = build_exc_ptr ();
>         exp = build1 (NOP_EXPR, build_pointer_type (type), exp);
> !       exp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (exp), exp,
>   		    fold_build1_loc (input_location,
> ! 				 NEGATE_EXPR, sizetype,
> ! 			 	 TYPE_SIZE_UNIT (TREE_TYPE (exp))));
>         exp = cp_build_indirect_ref (exp, RO_NULL, tf_warning_or_error);
>         initialize_handler_parm (decl, exp);
>         return type;
> --- 452,461 ----
>   	 generic exception header.  */
>         exp = build_exc_ptr ();
>         exp = build1 (NOP_EXPR, build_pointer_type (type), exp);
> !       exp = fold_build_pointer_plus (exp,
>   		    fold_build1_loc (input_location,
> ! 				     NEGATE_EXPR, sizetype,
> ! 				     TYPE_SIZE_UNIT (TREE_TYPE (exp))));
>         exp = cp_build_indirect_ref (exp, RO_NULL, tf_warning_or_error);
>         initialize_handler_parm (decl, exp);
>         return type;
> Index: trunk/gcc/cp/init.c
> ===================================================================
> *** trunk.orig/gcc/cp/init.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/cp/init.c	2011-07-11 17:13:24.000000000 +0200
> *************** expand_virtual_init (tree binfo, tree de
> *** 1063,1072 ****
>   
>         /* Compute the value to use, when there's a VTT.  */
>         vtt_parm = current_vtt_parm;
> !       vtbl2 = build2 (POINTER_PLUS_EXPR,
> ! 		      TREE_TYPE (vtt_parm),
> ! 		      vtt_parm,
> ! 		      vtt_index);
>         vtbl2 = cp_build_indirect_ref (vtbl2, RO_NULL, tf_warning_or_error);
>         vtbl2 = convert (TREE_TYPE (vtbl), vtbl2);
>   
> --- 1063,1069 ----
>   
>         /* Compute the value to use, when there's a VTT.  */
>         vtt_parm = current_vtt_parm;
> !       vtbl2 = fold_build_pointer_plus (vtt_parm, vtt_index);
>         vtbl2 = cp_build_indirect_ref (vtbl2, RO_NULL, tf_warning_or_error);
>         vtbl2 = convert (TREE_TYPE (vtbl), vtbl2);
>   
> *************** build_new_1 (VEC(tree,gc) **placement, t
> *** 2310,2325 ****
>         tree size_ptr_type;
>   
>         /* Adjust so we're pointing to the start of the object.  */
> !       data_addr = build2 (POINTER_PLUS_EXPR, TREE_TYPE (alloc_node),
> ! 			  alloc_node, cookie_size);
>   
>         /* Store the number of bytes allocated so that we can know how
>   	 many elements to destroy later.  We use the last sizeof
>   	 (size_t) bytes to store the number of elements.  */
>         cookie_ptr = size_binop (MINUS_EXPR, cookie_size, size_in_bytes (sizetype));
> !       cookie_ptr = fold_build2_loc (input_location,
> ! 				POINTER_PLUS_EXPR, TREE_TYPE (alloc_node),
> ! 				alloc_node, cookie_ptr);
>         size_ptr_type = build_pointer_type (sizetype);
>         cookie_ptr = fold_convert (size_ptr_type, cookie_ptr);
>         cookie = cp_build_indirect_ref (cookie_ptr, RO_NULL, complain);
> --- 2307,2320 ----
>         tree size_ptr_type;
>   
>         /* Adjust so we're pointing to the start of the object.  */
> !       data_addr = fold_build_pointer_plus (alloc_node, cookie_size);
>   
>         /* Store the number of bytes allocated so that we can know how
>   	 many elements to destroy later.  We use the last sizeof
>   	 (size_t) bytes to store the number of elements.  */
>         cookie_ptr = size_binop (MINUS_EXPR, cookie_size, size_in_bytes (sizetype));
> !       cookie_ptr = fold_build_pointer_plus_loc (input_location,
> ! 						alloc_node, cookie_ptr);
>         size_ptr_type = build_pointer_type (sizetype);
>         cookie_ptr = fold_convert (size_ptr_type, cookie_ptr);
>         cookie = cp_build_indirect_ref (cookie_ptr, RO_NULL, complain);
> *************** build_new_1 (VEC(tree,gc) **placement, t
> *** 2329,2338 ****
>         if (targetm.cxx.cookie_has_size ())
>   	{
>   	  /* Also store the element size.  */
> ! 	  cookie_ptr = build2 (POINTER_PLUS_EXPR, size_ptr_type, cookie_ptr,
>   			       fold_build1_loc (input_location,
> ! 					    NEGATE_EXPR, sizetype,
> ! 					    size_in_bytes (sizetype)));
>   
>   	  cookie = cp_build_indirect_ref (cookie_ptr, RO_NULL, complain);
>   	  cookie = build2 (MODIFY_EXPR, sizetype, cookie,
> --- 2324,2333 ----
>         if (targetm.cxx.cookie_has_size ())
>   	{
>   	  /* Also store the element size.  */
> ! 	  cookie_ptr = fold_build_pointer_plus (cookie_ptr,
>   			       fold_build1_loc (input_location,
> ! 						NEGATE_EXPR, sizetype,
> ! 						size_in_bytes (sizetype)));
>   
>   	  cookie = cp_build_indirect_ref (cookie_ptr, RO_NULL, complain);
>   	  cookie = build2 (MODIFY_EXPR, sizetype, cookie,
> *************** build_vec_delete_1 (tree base, tree maxi
> *** 2801,2812 ****
>   			     convert (sizetype, maxindex));
>   
>     tbase = create_temporary_var (ptype);
> !   tbase_init = cp_build_modify_expr (tbase, NOP_EXPR,
> ! 				     fold_build2_loc (input_location,
> ! 						  POINTER_PLUS_EXPR, ptype,
> ! 						  fold_convert (ptype, base),
> ! 						  virtual_size),
> ! 				     complain);
>     if (tbase_init == error_mark_node)
>       return error_mark_node;
>     controller = build3 (BIND_EXPR, void_type_node, tbase,
> --- 2796,2808 ----
>   			     convert (sizetype, maxindex));
>   
>     tbase = create_temporary_var (ptype);
> !   tbase_init
> !     = cp_build_modify_expr (tbase, NOP_EXPR,
> ! 			    fold_build_pointer_plus_loc (input_location,
> ! 							 fold_convert (ptype,
> ! 								       base),
> ! 							 virtual_size),
> ! 			    complain);
>     if (tbase_init == error_mark_node)
>       return error_mark_node;
>     controller = build3 (BIND_EXPR, void_type_node, tbase,
> *************** build_vec_delete_1 (tree base, tree maxi
> *** 2817,2823 ****
>   		 build2 (EQ_EXPR, boolean_type_node, tbase,
>   			 fold_convert (ptype, base)));
>     tmp = fold_build1_loc (input_location, NEGATE_EXPR, sizetype, size_exp);
> !   tmp = build2 (POINTER_PLUS_EXPR, ptype, tbase, tmp);
>     tmp = cp_build_modify_expr (tbase, NOP_EXPR, tmp, complain);
>     if (tmp == error_mark_node)
>       return error_mark_node;
> --- 2813,2819 ----
>   		 build2 (EQ_EXPR, boolean_type_node, tbase,
>   			 fold_convert (ptype, base)));
>     tmp = fold_build1_loc (input_location, NEGATE_EXPR, sizetype, size_exp);
> !   tmp = fold_build_pointer_plus (tbase, tmp);
>     tmp = cp_build_modify_expr (tbase, NOP_EXPR, tmp, complain);
>     if (tmp == error_mark_node)
>       return error_mark_node;
> *************** build_vec_delete (tree base, tree maxind
> *** 3751,3760 ****
>         type = strip_array_types (TREE_TYPE (type));
>         cookie_addr = fold_build1_loc (input_location, NEGATE_EXPR,
>   				 sizetype, TYPE_SIZE_UNIT (sizetype));
> !       cookie_addr = build2 (POINTER_PLUS_EXPR,
> ! 			    size_ptr_type,
> ! 			    fold_convert (size_ptr_type, base),
> ! 			    cookie_addr);
>         maxindex = cp_build_indirect_ref (cookie_addr, RO_NULL, complain);
>       }
>     else if (TREE_CODE (type) == ARRAY_TYPE)
> --- 3747,3754 ----
>         type = strip_array_types (TREE_TYPE (type));
>         cookie_addr = fold_build1_loc (input_location, NEGATE_EXPR,
>   				 sizetype, TYPE_SIZE_UNIT (sizetype));
> !       cookie_addr = fold_build_pointer_plus (fold_convert (size_ptr_type, base),
> ! 					     cookie_addr);
>         maxindex = cp_build_indirect_ref (cookie_addr, RO_NULL, complain);
>       }
>     else if (TREE_CODE (type) == ARRAY_TYPE)
> Index: trunk/gcc/cp/rtti.c
> ===================================================================
> *** trunk.orig/gcc/cp/rtti.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/cp/rtti.c	2011-07-11 17:13:24.000000000 +0200
> *************** build_headof (tree exp)
> *** 192,199 ****
>   
>     type = cp_build_qualified_type (ptr_type_node,
>   				  cp_type_quals (TREE_TYPE (exp)));
> !   return build2 (POINTER_PLUS_EXPR, type, exp,
> ! 		 convert_to_integer (sizetype, offset));
>   }
>   
>   /* Get a bad_cast node for the program to throw...
> --- 192,198 ----
>   
>     type = cp_build_qualified_type (ptr_type_node,
>   				  cp_type_quals (TREE_TYPE (exp)));
> !   return fold_build_pointer_plus (exp, offset);
>   }
>   
>   /* Get a bad_cast node for the program to throw...
> *************** tinfo_base_init (tinfo_s *ti, tree targe
> *** 918,925 ****
>         vtable_ptr = cp_build_addr_expr (vtable_ptr, tf_warning_or_error);
>   
>         /* We need to point into the middle of the vtable.  */
> !       vtable_ptr = build2
> ! 	(POINTER_PLUS_EXPR, TREE_TYPE (vtable_ptr), vtable_ptr,
>   	 size_binop (MULT_EXPR,
>   		     size_int (2 * TARGET_VTABLE_DATA_ENTRY_DISTANCE),
>   		     TYPE_SIZE_UNIT (vtable_entry_type)));
> --- 917,924 ----
>         vtable_ptr = cp_build_addr_expr (vtable_ptr, tf_warning_or_error);
>   
>         /* We need to point into the middle of the vtable.  */
> !       vtable_ptr = fold_build_pointer_plus
> ! 	(vtable_ptr,
>   	 size_binop (MULT_EXPR,
>   		     size_int (2 * TARGET_VTABLE_DATA_ENTRY_DISTANCE),
>   		     TYPE_SIZE_UNIT (vtable_entry_type)));
> Index: trunk/gcc/cp/typeck.c
> ===================================================================
> *** trunk.orig/gcc/cp/typeck.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/cp/typeck.c	2011-07-11 17:13:24.000000000 +0200
> *************** get_member_function_from_ptrfunc (tree *
> *** 3078,3085 ****
>   	    return error_mark_node;
>   	}
>         /* ...and then the delta in the PMF.  */
> !       instance_ptr = build2 (POINTER_PLUS_EXPR, TREE_TYPE (instance_ptr),
> ! 			     instance_ptr, fold_convert (sizetype, delta));
>   
>         /* Hand back the adjusted 'this' argument to our caller.  */
>         *instance_ptrptr = instance_ptr;
> --- 3078,3084 ----
>   	    return error_mark_node;
>   	}
>         /* ...and then the delta in the PMF.  */
> !       instance_ptr = fold_build_pointer_plus (instance_ptr, delta);
>   
>         /* Hand back the adjusted 'this' argument to our caller.  */
>         *instance_ptrptr = instance_ptr;
> *************** get_member_function_from_ptrfunc (tree *
> *** 3094,3102 ****
>         TREE_NO_WARNING (vtbl) = 1;
>   
>         /* Finally, extract the function pointer from the vtable.  */
> !       e2 = fold_build2_loc (input_location,
> ! 			POINTER_PLUS_EXPR, TREE_TYPE (vtbl), vtbl,
> ! 			fold_convert (sizetype, idx));
>         e2 = cp_build_indirect_ref (e2, RO_NULL, tf_warning_or_error);
>         TREE_CONSTANT (e2) = 1;
>   
> --- 3093,3099 ----
>         TREE_NO_WARNING (vtbl) = 1;
>   
>         /* Finally, extract the function pointer from the vtable.  */
> !       e2 = fold_build_pointer_plus_loc (input_location, vtbl, idx);
>         e2 = cp_build_indirect_ref (e2, RO_NULL, tf_warning_or_error);
>         TREE_CONSTANT (e2) = 1;
>   
> *************** cp_build_addr_expr_1 (tree arg, bool str
> *** 4841,4848 ****
>       {
>         tree type = build_pointer_type (argtype);
>         tree op0 = fold_convert (type, TREE_OPERAND (val, 0));
> !       tree op1 = fold_convert (sizetype, fold_offsetof (arg, val));
> !       return fold_build2 (POINTER_PLUS_EXPR, type, op0, op1);
>       }
>   
>     /* Handle complex lvalues (when permitted)
> --- 4838,4845 ----
>       {
>         tree type = build_pointer_type (argtype);
>         tree op0 = fold_convert (type, TREE_OPERAND (val, 0));
> !       tree op1 = fold_offsetof (arg, val);
> !       return fold_build_pointer_plus (op0, op1);
>       }
>   
>     /* Handle complex lvalues (when permitted)
> Index: trunk/gcc/cp/typeck2.c
> ===================================================================
> *** trunk.orig/gcc/cp/typeck2.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/cp/typeck2.c	2011-07-11 17:13:24.000000000 +0200
> *************** build_m_component_ref (tree datum, tree
> *** 1566,1574 ****
>         /* Build an expression for "object + offset" where offset is the
>   	 value stored in the pointer-to-data-member.  */
>         ptype = build_pointer_type (type);
> !       datum = build2 (POINTER_PLUS_EXPR, ptype,
> ! 		      fold_convert (ptype, datum),
> ! 		      build_nop (sizetype, component));
>         datum = cp_build_indirect_ref (datum, RO_NULL, tf_warning_or_error);
>         /* If the object expression was an rvalue, return an rvalue.  */
>         if (!is_lval)
> --- 1566,1572 ----
>         /* Build an expression for "object + offset" where offset is the
>   	 value stored in the pointer-to-data-member.  */
>         ptype = build_pointer_type (type);
> !       datum = fold_build_pointer_plus (fold_convert (ptype, datum), component);
>         datum = cp_build_indirect_ref (datum, RO_NULL, tf_warning_or_error);
>         /* If the object expression was an rvalue, return an rvalue.  */
>         if (!is_lval)
> Index: trunk/gcc/fortran/trans-expr.c
> ===================================================================
> *** trunk.orig/gcc/fortran/trans-expr.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/fortran/trans-expr.c	2011-07-11 17:13:24.000000000 +0200
> *************** fill_with_spaces (tree start, tree type,
> *** 3788,3795 ****
>   		  fold_build2_loc (input_location, MINUS_EXPR, sizetype, i,
>   				   TYPE_SIZE_UNIT (type)));
>     gfc_add_modify (&loop, el,
> ! 		  fold_build2_loc (input_location, POINTER_PLUS_EXPR,
> ! 				   TREE_TYPE (el), el, TYPE_SIZE_UNIT (type)));
>   
>     /* Making the loop... actually loop!  */
>     tmp = gfc_finish_block (&loop);
> --- 3788,3795 ----
>   		  fold_build2_loc (input_location, MINUS_EXPR, sizetype, i,
>   				   TYPE_SIZE_UNIT (type)));
>     gfc_add_modify (&loop, el,
> ! 		  fold_build_pointer_plus_loc (input_location,
> ! 					       el, TYPE_SIZE_UNIT (type)));
>   
>     /* Making the loop... actually loop!  */
>     tmp = gfc_finish_block (&loop);
> *************** gfc_trans_string_copy (stmtblock_t * blo
> *** 3915,3922 ****
>   			  built_in_decls[BUILT_IN_MEMMOVE],
>   			  3, dest, src, slen);
>   
> !   tmp4 = fold_build2_loc (input_location, POINTER_PLUS_EXPR, TREE_TYPE (dest),
> ! 			  dest, fold_convert (sizetype, slen));
>     tmp4 = fill_with_spaces (tmp4, chartype,
>   			   fold_build2_loc (input_location, MINUS_EXPR,
>   					    TREE_TYPE(dlen), dlen, slen));
> --- 3915,3921 ----
>   			  built_in_decls[BUILT_IN_MEMMOVE],
>   			  3, dest, src, slen);
>   
> !   tmp4 = fold_build_pointer_plus_loc (input_location, dest, slen);
>     tmp4 = fill_with_spaces (tmp4, chartype,
>   			   fold_build2_loc (input_location, MINUS_EXPR,
>   					    TREE_TYPE(dlen), dlen, slen));
> Index: trunk/gcc/fortran/trans-intrinsic.c
> ===================================================================
> *** trunk.orig/gcc/fortran/trans-intrinsic.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/fortran/trans-intrinsic.c	2011-07-11 17:13:24.000000000 +0200
> *************** gfc_conv_intrinsic_repeat (gfc_se * se,
> *** 5998,6006 ****
>   			 fold_convert (gfc_charlen_type_node, count));
>     tmp = fold_build2_loc (input_location, MULT_EXPR, gfc_charlen_type_node,
>   			 tmp, fold_convert (gfc_charlen_type_node, size));
> !   tmp = fold_build2_loc (input_location, POINTER_PLUS_EXPR, pvoid_type_node,
> ! 			 fold_convert (pvoid_type_node, dest),
> ! 			 fold_convert (sizetype, tmp));
>     tmp = build_call_expr_loc (input_location,
>   			     built_in_decls[BUILT_IN_MEMMOVE], 3, tmp, src,
>   			     fold_build2_loc (input_location, MULT_EXPR,
> --- 5998,6005 ----
>   			 fold_convert (gfc_charlen_type_node, count));
>     tmp = fold_build2_loc (input_location, MULT_EXPR, gfc_charlen_type_node,
>   			 tmp, fold_convert (gfc_charlen_type_node, size));
> !   tmp = fold_build_pointer_plus_loc (input_location,
> ! 				     fold_convert (pvoid_type_node, dest), tmp);
>     tmp = build_call_expr_loc (input_location,
>   			     built_in_decls[BUILT_IN_MEMMOVE], 3, tmp, src,
>   			     fold_build2_loc (input_location, MULT_EXPR,
> Index: trunk/gcc/fortran/trans-types.c
> ===================================================================
> *** trunk.orig/gcc/fortran/trans-types.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/fortran/trans-types.c	2011-07-11 17:13:24.000000000 +0200
> *************** gfc_get_array_descr_info (const_tree typ
> *** 2885,2891 ****
>   
>     t = base_decl;
>     if (!integer_zerop (data_off))
> !     t = build2 (POINTER_PLUS_EXPR, ptype, t, data_off);
>     t = build1 (NOP_EXPR, build_pointer_type (ptr_type_node), t);
>     info->data_location = build1 (INDIRECT_REF, ptr_type_node, t);
>     if (GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
> --- 2885,2891 ----
>   
>     t = base_decl;
>     if (!integer_zerop (data_off))
> !     t = fold_build_pointer_plus (t, data_off);
>     t = build1 (NOP_EXPR, build_pointer_type (ptr_type_node), t);
>     info->data_location = build1 (INDIRECT_REF, ptr_type_node, t);
>     if (GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
> *************** gfc_get_array_descr_info (const_tree typ
> *** 2898,2909 ****
>   
>     for (dim = 0; dim < rank; dim++)
>       {
> !       t = build2 (POINTER_PLUS_EXPR, ptype, base_decl,
> ! 		  size_binop (PLUS_EXPR, dim_off, lower_suboff));
>         t = build1 (INDIRECT_REF, gfc_array_index_type, t);
>         info->dimen[dim].lower_bound = t;
> !       t = build2 (POINTER_PLUS_EXPR, ptype, base_decl,
> ! 		  size_binop (PLUS_EXPR, dim_off, upper_suboff));
>         t = build1 (INDIRECT_REF, gfc_array_index_type, t);
>         info->dimen[dim].upper_bound = t;
>         if (GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ASSUMED_SHAPE
> --- 2898,2911 ----
>   
>     for (dim = 0; dim < rank; dim++)
>       {
> !       t = fold_build_pointer_plus (base_decl,
> ! 				   size_binop (PLUS_EXPR,
> ! 					       dim_off, lower_suboff));
>         t = build1 (INDIRECT_REF, gfc_array_index_type, t);
>         info->dimen[dim].lower_bound = t;
> !       t = fold_build_pointer_plus (base_decl,
> ! 				   size_binop (PLUS_EXPR,
> ! 					       dim_off, upper_suboff));
>         t = build1 (INDIRECT_REF, gfc_array_index_type, t);
>         info->dimen[dim].upper_bound = t;
>         if (GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ASSUMED_SHAPE
> *************** gfc_get_array_descr_info (const_tree typ
> *** 2922,2929 ****
>   		      info->dimen[dim].lower_bound,
>   		      info->dimen[dim].upper_bound);
>   	}
> !       t = build2 (POINTER_PLUS_EXPR, ptype, base_decl,
> ! 		  size_binop (PLUS_EXPR, dim_off, stride_suboff));
>         t = build1 (INDIRECT_REF, gfc_array_index_type, t);
>         t = build2 (MULT_EXPR, gfc_array_index_type, t, elem_size);
>         info->dimen[dim].stride = t;
> --- 2924,2932 ----
>   		      info->dimen[dim].lower_bound,
>   		      info->dimen[dim].upper_bound);
>   	}
> !       t = fold_build_pointer_plus (base_decl,
> ! 				   size_binop (PLUS_EXPR,
> ! 					       dim_off, stride_suboff));
>         t = build1 (INDIRECT_REF, gfc_array_index_type, t);
>         t = build2 (MULT_EXPR, gfc_array_index_type, t, elem_size);
>         info->dimen[dim].stride = t;
> Index: trunk/gcc/fortran/trans.c
> ===================================================================
> *** trunk.orig/gcc/fortran/trans.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/fortran/trans.c	2011-07-11 17:13:24.000000000 +0200
> *************** gfc_build_array_ref (tree base, tree off
> *** 345,353 ****
>   				gfc_array_index_type,
>   				offset, GFC_DECL_SPAN(decl));
>         tmp = gfc_build_addr_expr (pvoid_type_node, base);
> !       tmp = fold_build2_loc (input_location, POINTER_PLUS_EXPR,
> ! 			     pvoid_type_node, tmp,
> ! 			     fold_convert (sizetype, offset));
>         tmp = fold_convert (build_pointer_type (type), tmp);
>         if (!TYPE_STRING_FLAG (type))
>   	tmp = build_fold_indirect_ref_loc (input_location, tmp);
> --- 345,351 ----
>   				gfc_array_index_type,
>   				offset, GFC_DECL_SPAN(decl));
>         tmp = gfc_build_addr_expr (pvoid_type_node, base);
> !       tmp = fold_build_pointer_plus_loc (input_location, tmp, offset);
>         tmp = fold_convert (build_pointer_type (type), tmp);
>         if (!TYPE_STRING_FLAG (type))
>   	tmp = build_fold_indirect_ref_loc (input_location, tmp);
> Index: trunk/gcc/java/builtins.c
> ===================================================================
> *** trunk.orig/gcc/java/builtins.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/java/builtins.c	2011-07-11 17:13:24.000000000 +0200
> *************** static tree
> *** 283,292 ****
>   build_addr_sum (tree type, tree addr, tree offset)
>   {
>     tree ptr_type = build_pointer_type (type);
> !   return fold_build2 (POINTER_PLUS_EXPR,
> ! 		      ptr_type,
> ! 		      fold_convert (ptr_type, addr),
> ! 		      fold_convert (sizetype, offset));
>   }
>   
>   /* Make sure that this-arg is non-NULL.  This is a security check.  */
> --- 283,289 ----
>   build_addr_sum (tree type, tree addr, tree offset)
>   {
>     tree ptr_type = build_pointer_type (type);
> !   return fold_build_pointer_plus (fold_convert (ptr_type, addr), offset);
>   }
>   
>   /* Make sure that this-arg is non-NULL.  This is a security check.  */
> Index: trunk/gcc/java/class.c
> ===================================================================
> *** trunk.orig/gcc/java/class.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/java/class.c	2011-07-11 17:13:24.000000000 +0200
> *************** make_class_data (tree type)
> *** 2085,2094 ****
>     PUSH_FIELD_VALUE (v1, "vtable",
>   		    (flag_indirect_classes 
>   		     ? null_pointer_node
> ! 		     : build2 (POINTER_PLUS_EXPR, dtable_ptr_type,
> ! 			       build1 (ADDR_EXPR, dtable_ptr_type,
> ! 				       class_dtable_decl),
> ! 			       dtable_start_offset)));
>     if (! flag_hash_synchronization)
>       PUSH_FIELD_VALUE (v1, "sync_info", null_pointer_node);
>     FINISH_RECORD_CONSTRUCTOR (temp, v1, object_type_node);
> --- 2085,2094 ----
>     PUSH_FIELD_VALUE (v1, "vtable",
>   		    (flag_indirect_classes 
>   		     ? null_pointer_node
> ! 		     : fold_build_pointer_plus
> ! 			 (build1 (ADDR_EXPR, dtable_ptr_type,
> ! 				  class_dtable_decl),
> ! 			  dtable_start_offset)));
>     if (! flag_hash_synchronization)
>       PUSH_FIELD_VALUE (v1, "sync_info", null_pointer_node);
>     FINISH_RECORD_CONSTRUCTOR (temp, v1, object_type_node);
> *************** make_class_data (tree type)
> *** 2131,2140 ****
>     PUSH_FIELD_VALUE (v2, "vtable",
>                       (flag_indirect_dispatch || dtable_decl == NULL_TREE
>                        ? null_pointer_node
> !                      : build2 (POINTER_PLUS_EXPR, dtable_ptr_type,
> ! 				build1 (ADDR_EXPR, dtable_ptr_type,
> ! 					dtable_decl),
> !                                dtable_start_offset)));
>     add_table_and_syms (&v2, TYPE_OTABLE_METHODS (type),
>                         "otable", TYPE_OTABLE_DECL (type), otable_ptr_type,
>                         "otable_syms", TYPE_OTABLE_SYMS_DECL (type));
> --- 2131,2140 ----
>     PUSH_FIELD_VALUE (v2, "vtable",
>                       (flag_indirect_dispatch || dtable_decl == NULL_TREE
>                        ? null_pointer_node
> !                      : fold_build_pointer_plus
> ! 			 (build1 (ADDR_EXPR, dtable_ptr_type,
> ! 				  dtable_decl),
> ! 			  dtable_start_offset)));
>     add_table_and_syms (&v2, TYPE_OTABLE_METHODS (type),
>                         "otable", TYPE_OTABLE_DECL (type), otable_ptr_type,
>                         "otable_syms", TYPE_OTABLE_SYMS_DECL (type));
> *************** build_symbol_entry (tree decl, tree spec
> *** 2896,2903 ****
>        system that this is a "special" symbol, i.e. one that should
>        bypass access controls.  */
>     if (special != NULL_TREE)
> !     signature = build2 (POINTER_PLUS_EXPR, TREE_TYPE (signature), signature,
> ! 			fold_convert (sizetype, special));
>   
>     return build_symbol_table_entry (clname, name, signature);
>   } 
> --- 2896,2902 ----
>        system that this is a "special" symbol, i.e. one that should
>        bypass access controls.  */
>     if (special != NULL_TREE)
> !     signature = fold_build_pointer_plus (signature, special);
>   
>     return build_symbol_table_entry (clname, name, signature);
>   } 
> Index: trunk/gcc/java/except.c
> ===================================================================
> *** trunk.orig/gcc/java/except.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/java/except.c	2011-07-11 17:13:24.000000000 +0200
> *************** build_exception_object_ref (tree type)
> *** 488,494 ****
>        The java object is immediately before the generic exception header.  */
>     obj = build_exception_object_var ();
>     obj = fold_convert (build_pointer_type (type), obj);
> !   obj = build2 (POINTER_PLUS_EXPR, TREE_TYPE (obj), obj,
>   		fold_build1 (NEGATE_EXPR, sizetype,
>   			     TYPE_SIZE_UNIT (TREE_TYPE (obj))));
>     obj = build1 (INDIRECT_REF, type, obj);
> --- 488,494 ----
>        The java object is immediately before the generic exception header.  */
>     obj = build_exception_object_var ();
>     obj = fold_convert (build_pointer_type (type), obj);
> !   obj = fold_build_pointer_plus (obj,
>   		fold_build1 (NEGATE_EXPR, sizetype,
>   			     TYPE_SIZE_UNIT (TREE_TYPE (obj))));
>     obj = build1 (INDIRECT_REF, type, obj);
> Index: trunk/gcc/java/expr.c
> ===================================================================
> *** trunk.orig/gcc/java/expr.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/java/expr.c	2011-07-11 17:13:24.000000000 +0200
> *************** build_java_arrayaccess (tree array, tree
> *** 936,942 ****
>   		  size_exp);
>   
>     /* Sum the byte offset and the address of the data field.  */
> !   node = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (node), node, index);
>   
>     /* Finally, return
>   
> --- 936,942 ----
>   		  size_exp);
>   
>     /* Sum the byte offset and the address of the data field.  */
> !   node = fold_build_pointer_plus (node, index);
>   
>     /* Finally, return
>   
> *************** build_field_ref (tree self_value, tree s
> *** 1743,1754 ****
>   					 1, otable_index),
>   			field_offset);
>   	  
> - 	  field_offset = fold (convert (sizetype, field_offset));
>   	  self_value = java_check_reference (self_value, check);
> ! 	  address 
> ! 	    = fold_build2 (POINTER_PLUS_EXPR, 
> ! 			   TREE_TYPE (self_value),
> ! 			   self_value, field_offset);
>   	  address = fold_convert (build_pointer_type (TREE_TYPE (field_decl)),
>   				  address);
>   	  return fold_build1 (INDIRECT_REF, TREE_TYPE (field_decl), address);
> --- 1743,1750 ----
>   					 1, otable_index),
>   			field_offset);
>   	  
>   	  self_value = java_check_reference (self_value, check);
> ! 	  address = fold_build_pointer_plus (self_value, field_offset);
>   	  address = fold_convert (build_pointer_type (TREE_TYPE (field_decl)),
>   				  address);
>   	  return fold_build1 (INDIRECT_REF, TREE_TYPE (field_decl), address);
> *************** build_known_method_ref (tree method, tre
> *** 2255,2262 ****
>   	  method_index++;
>   	}
>         method_index *= int_size_in_bytes (method_type_node);
> !       ref = fold_build2 (POINTER_PLUS_EXPR, method_ptr_type_node,
> ! 			 ref, size_int (method_index));
>         ref = build1 (INDIRECT_REF, method_type_node, ref);
>         func = build3 (COMPONENT_REF, nativecode_ptr_type_node,
>   		     ref, lookup_field (&method_type_node, ncode_ident),
> --- 2251,2257 ----
>   	  method_index++;
>   	}
>         method_index *= int_size_in_bytes (method_type_node);
> !       ref = fold_build_pointer_plus_hwi (ref, method_index);
>         ref = build1 (INDIRECT_REF, method_type_node, ref);
>         func = build3 (COMPONENT_REF, nativecode_ptr_type_node,
>   		     ref, lookup_field (&method_type_node, ncode_ident),
> *************** build_invokevirtual (tree dtable, tree m
> *** 2349,2356 ****
>   				   size_int (TARGET_VTABLE_USES_DESCRIPTORS));
>       }
>   
> !   func = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (dtable), dtable,
> ! 		      convert (sizetype, method_index));
>   
>     if (TARGET_VTABLE_USES_DESCRIPTORS)
>       func = build1 (NOP_EXPR, nativecode_ptr_type_node, func);
> --- 2344,2350 ----
>   				   size_int (TARGET_VTABLE_USES_DESCRIPTORS));
>       }
>   
> !   func = fold_build_pointer_plus (dtable, method_index);
>   
>     if (TARGET_VTABLE_USES_DESCRIPTORS)
>       func = build1 (NOP_EXPR, nativecode_ptr_type_node, func);
> Index: trunk/gcc/objc/objc-next-runtime-abi-02.c
> ===================================================================
> *** trunk.orig/gcc/objc/objc-next-runtime-abi-02.c	2011-07-11 17:12:41.000000000 +0200
> --- trunk/gcc/objc/objc-next-runtime-abi-02.c	2011-07-11 17:13:24.000000000 +0200
> *************** objc_v2_build_ivar_ref (tree datum, tree
> *** 1381,1388 ****
>   		       string_type_node, build_fold_addr_expr (datum));
>   
>     /* (char*)datum + offset */
> !   expr = fold_build2_loc (input_location,
> ! 			  POINTER_PLUS_EXPR, string_type_node, expr, offset);
>   
>     /* (ftype*)((char*)datum + offset) */
>     expr = build_c_cast (input_location, build_pointer_type (ftype), expr);
> --- 1381,1387 ----
>   		       string_type_node, build_fold_addr_expr (datum));
>   
>     /* (char*)datum + offset */
> !   expr = fold_build_pointer_plus_loc (input_location, expr, offset);
>   
>     /* (ftype*)((char*)datum + offset) */
>     expr = build_c_cast (input_location, build_pointer_type (ftype), expr);
> *************** objc2_build_ehtype_initializer (tree nam
> *** 3486,3492 ****
>       }
>     addr = build_fold_addr_expr_with_type (next_v2_ehvtable_decl, ptr_type_node);
>     offs = size_int (2 * int_cst_value (TYPE_SIZE_UNIT (ptr_type_node)));
> !   addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, addr, offs);
>   
>     CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, addr);
>   
> --- 3485,3491 ----
>       }
>     addr = build_fold_addr_expr_with_type (next_v2_ehvtable_decl, ptr_type_node);
>     offs = size_int (2 * int_cst_value (TYPE_SIZE_UNIT (ptr_type_node)));
> !   addr = fold_build_pointer_plus (addr, offs);
>   
>     CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, addr);
>   
> Index: trunk/gcc/tree.h
> ===================================================================
> *** trunk.orig/gcc/tree.h	2011-07-11 17:13:09.000000000 +0200
> --- trunk/gcc/tree.h	2011-07-11 17:14:36.000000000 +0200
> *************** truth_value_p (enum tree_code code)
> *** 5316,5321 ****
> --- 5316,5340 ----
>   	  || code == TRUTH_XOR_EXPR || code == TRUTH_NOT_EXPR);
>   }
>   
> + /* Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF.  */
> + static inline tree
> + fold_build_pointer_plus_loc (location_t loc, tree ptr, tree off)
> + {
> +   return fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (ptr),
> + 			  ptr, fold_convert_loc (loc, sizetype, off));
> + }
> + #define fold_build_pointer_plus(p,o) \
> + 	fold_build_pointer_plus_loc (UNKNOWN_LOCATION, p, o)
> + 
> + /* Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF.  */
> + static inline tree
> + fold_build_pointer_plus_hwi_loc (location_t loc, tree ptr, HOST_WIDE_INT off)
> + {
> +   return fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (ptr),
> + 			  ptr, size_int (off));
> + }
> + #define fold_build_pointer_plus_hwi(p,o) \
> + 	fold_build_pointer_plus_hwi_loc (UNKNOWN_LOCATION, p, o)
>   
>   /* In builtins.c */
>   extern tree fold_call_expr (location_t, tree, bool);
> 

-- 
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer

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