Re: [PATCH] Remove bogus PLUS_EXPR -> POINTER_PLUS_EXPR folding

Andrew Haley <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Richard Guenther wrote:

> 2009-01-16  Richard Guenther  <[email protected]>
> 
> 	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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.