This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto-streamer] Fix pr36245
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Bill Maddox <maddox at google dot com>
- Date: Fri, 30 May 2008 12:18:23 -0400
- Subject: [lto-streamer] Fix pr36245
For some reason, the test case for pr36245 is in the branch but not
the actual patch from richi. Fixed with
2008-05-30 Diego Novillo <dnovillo@google.com>
Backport from trunk:
2008-05-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36245
* tree-ssa-address.c (add_to_parts): Deal with non-pointer
bases.
Index: tree-ssa-address.c
===================================================================
--- tree-ssa-address.c (revision 136188)
+++ tree-ssa-address.c (working copy)
@@ -423,9 +423,13 @@ add_to_parts (struct mem_address *parts,
/* Add ELT to base. */
type = TREE_TYPE (parts->base);
- parts->base = fold_build2 (POINTER_PLUS_EXPR, type,
- parts->base,
- fold_convert (sizetype, elt));
+ 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);
}
/* Finds the most expensive multiplication in ADDR that can be