diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-04 00:33:31 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-04 00:33:31 +0000 |
commit | e45bbad21b8f3590c89cc7193eaac430b547328f (patch) | |
tree | 5bc2b122837ec11f3ca351c56ec17682a79d19ee /gcc | |
parent | 6e667ff8580e6af3312ac46bd499ed6d9f668c30 (diff) | |
download | gcc-e45bbad21b8f3590c89cc7193eaac430b547328f.tar.gz |
2007-08-03 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/32399
* tree-ssa-address.c (add_to_parts): Use POINTER_PLUS_EXPR
when adding to the base and convert ELT to sizetype instead of type.
2007-08-03 Andrew Pinski <andrew_pinski@playstation.sony.com>
RP middle-end/32399
* gcc.c-torture/compile/pr32399.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127196 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr32399.c | 16 | ||||
-rw-r--r-- | gcc/tree-ssa-address.c | 4 |
4 files changed, 29 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eeb4a51e0dd..b2bff862809 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2007-08-03 Andrew Pinski <andrew_pinski@playstation.sony.com> + PR middle-end/32399 + * tree-ssa-address.c (add_to_parts): Use POINTER_PLUS_EXPR + when adding to the base and convert ELT to sizetype instead of type. + +2007-08-03 Andrew Pinski <andrew_pinski@playstation.sony.com> + PR middle-end/32304 * ipa-reference.c (has_proper_scope_for_analysis): Return false when the decl's type has TYPE_NEEDS_CONSTRUCTING set. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ce38fc75bf8..8814bd2cbaa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2007-08-03 Andrew Pinski <andrew_pinski@playstation.sony.com> + RP middle-end/32399 + * gcc.c-torture/compile/pr32399.c: New testcase. + +2007-08-03 Andrew Pinski <andrew_pinski@playstation.sony.com> + PR middle-end/32304 * g++.dg/torture/pr32304.C: New testcase. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr32399.c b/gcc/testsuite/gcc.c-torture/compile/pr32399.c new file mode 100644 index 00000000000..cc2b1b18984 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr32399.c @@ -0,0 +1,16 @@ +void f(unsigned char *src, unsigned char *dst, int num, unsigned char *pos, unsigned char *diffuse, int hasdiffuse, unsigned char *specular, int hasspecular) { + int i; + + for(i=num;i--;) { + float *p = (float *) ((__SIZE_TYPE__) dst + (__SIZE_TYPE__) pos); + if(hasdiffuse) { + unsigned int *dstColor = (unsigned int *) (dst + i + (__SIZE_TYPE__) diffuse); + *dstColor = * (unsigned int *) ( ((__SIZE_TYPE__) src + (__SIZE_TYPE__) diffuse) + i); + } + if(hasspecular) { + unsigned int *dstColor = (unsigned int *) (dst + i + (__SIZE_TYPE__) specular); + *dstColor = * (unsigned int *) ( ((__SIZE_TYPE__) src + (__SIZE_TYPE__) specular) + i); + } + } +} + diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c index 577ede32bcc..90a01dca034 100644 --- a/gcc/tree-ssa-address.c +++ b/gcc/tree-ssa-address.c @@ -422,9 +422,9 @@ add_to_parts (struct mem_address *parts, tree elt) /* Add ELT to base. */ type = TREE_TYPE (parts->base); - parts->base = fold_build2 (PLUS_EXPR, type, + parts->base = fold_build2 (POINTER_PLUS_EXPR, type, parts->base, - fold_convert (type, elt)); + fold_convert (sizetype, elt)); } /* Finds the most expensive multiplication in ADDR that can be |