This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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] Remove bogus PLUS_EXPR -> POINTER_PLUS_EXPR folding


Richard Guenther wrote:

> 2009-01-16  Richard Guenther  <rguenther@suse.de>
> 
> 	PR tree-optimization/38835
> 	PR middle-end/36227
> 
> 	java/
> 	* builtins.c (build_addr_sum): Use POINTER_PLUS_EXPR.
> 
> Index: gcc/java/builtins.c
> ===================================================================
> *** gcc/java/builtins.c	(revision 143429)
> --- gcc/java/builtins.c	(working copy)
> *************** static tree
> *** 265,273 ****
>   build_addr_sum (tree type, tree addr, tree offset)
>   {
>     tree ptr_type = build_pointer_type (type);
> !   return  fold_build2 (PLUS_EXPR, 
> ! 		       ptr_type, 
> ! 		       fold_convert (ptr_type, addr), offset);
>   }
>   
>   /* Make sure that this-arg is non-NULL.  This is a security check.  */
> --- 265,274 ----
>   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.  */

OK.

Andrew.


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