diff options
author | Diego Novillo <dnovillo@google.com> | 2008-05-30 16:11:58 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2008-05-30 16:11:58 +0000 |
commit | a51595a2b6729d321b00fa93aa8d3ba913585acf (patch) | |
tree | 7ed2529dc69f159624f67ef28a9de9cd3591ac5b | |
parent | b4e912a7f6521c7fecbf4bde2eb5e6166bb92d1f (diff) |
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.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto-streamer@136212 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.lto | 10 | ||||
-rw-r--r-- | gcc/tree-ssa-address.c | 10 |
2 files changed, 17 insertions, 3 deletions
diff --git a/gcc/ChangeLog.lto b/gcc/ChangeLog.lto index 2da2e94221a..2e9d35138d8 100644 --- a/gcc/ChangeLog.lto +++ b/gcc/ChangeLog.lto @@ -1,3 +1,13 @@ +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. + 2008-05-29 Bill Maddox <maddox@google.com> * lto-tree-in.h, lto-tree-out.h: New files, diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c index a5119d8c2bd..55d43a5e362 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 |