diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a6d1e210d1e0..bbe6eec73f85 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-05-27 Richard Guenther + + PR tree-optimization/36245 + * tree-ssa-address.c (add_to_parts): Deal with non-pointer + bases. + 2008-05-27 Andreas Krebbel * config/s390/s390.md: Replace all occurences of the 'm' diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c index a5119d8c2bde..55d43a5e362a 100644 --- a/gcc/tree-ssa-address.c +++ b/gcc/tree-ssa-address.c @@ -423,9 +423,13 @@ add_to_parts (struct mem_address *parts, tree elt) /* 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