+2011-09-27 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50363
+ * tree-ssa-pre.c (create_expression_by_pieces): Handle
+ pointer conversions in POINTER_PLUS_EXPRs properly.
+
2011-09-27 Richard Sandiford <richard.sandiford@linaro.org>
* config/arm/neon.md (neon_vget_highv16qi, neon_vget_highv8hi)
+2011-09-27 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50363
+ * gcc.dg/torture/pr50363.c: New testcase.
+
2011-09-26 Jason Merrill <jason@redhat.com>
PR c++/45012
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-ch -fno-tree-fre" } */
+
+void
+foo (int *__restrict__ * r, int n)
+{
+ int *p;
+ for (p = *r; p < *r + n; p++)
+ ;
+}
stmts, domstmt);
if (!genop[i])
return NULL_TREE;
- /* Ensure genop[1] is a ptrofftype for POINTER_PLUS_EXPR. It
- may be a constant with the wrong type. */
- if (i == 1
- && nary->opcode == POINTER_PLUS_EXPR)
- genop[i] = convert_to_ptrofftype (genop[i]);
+ /* Ensure genop[] is properly typed for POINTER_PLUS_EXPR. It
+ may have conversions stripped. */
+ if (nary->opcode == POINTER_PLUS_EXPR)
+ {
+ if (i == 0)
+ genop[i] = fold_convert (nary->type, genop[i]);
+ else if (i == 1)
+ genop[i] = convert_to_ptrofftype (genop[i]);
+ }
else
genop[i] = fold_convert (TREE_TYPE (nary->op[i]), genop[i]);
}