diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-27 13:10:18 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-27 13:10:18 +0000 |
commit | 36f0904bae8a3cffd401a43a765fb1e2e6e2af47 (patch) | |
tree | 9e81ea9a2cfa2b3f17aa296af3fde266bee91de1 /gcc/tree-ssa-address.c | |
parent | 3e169095bc41141ca4d5c8be7db388715db43884 (diff) | |
download | gcc-36f0904bae8a3cffd401a43a765fb1e2e6e2af47.tar.gz |
2008-05-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36245
* tree-ssa-address.c (add_to_parts): Deal with non-pointer
bases.
* gcc.c-torture/compile/pr36245.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136029 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-address.c')
-rw-r--r-- | gcc/tree-ssa-address.c | 10 |
1 files changed, 7 insertions, 3 deletions
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 |