This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] Remove bogus PLUS_EXPR -> POINTER_PLUS_EXPR folding
- From: Andrew Haley <aph at redhat dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, java at gcc dot gnu dot org, tromey at redhat dot com
- Date: Fri, 16 Jan 2009 18:46:48 +0000
- Subject: Re: [PATCH] Remove bogus PLUS_EXPR -> POINTER_PLUS_EXPR folding
- References: <alpine.LNX.2.00.0901161453350.24314@zhemvz.fhfr.qr> <alpine.LNX.2.00.0901161713450.24314@zhemvz.fhfr.qr>
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.