+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
+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
--- /dev/null
+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);
+ }
+ }
+}
+
/* 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