summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog.graphite8
-rw-r--r--gcc/graphite-clast-to-gimple.c3
-rw-r--r--gcc/testsuite/gcc.dg/graphite/id-19.c6
3 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index a24f4995789..89e1a0a2a3f 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,6 +1,14 @@
2010-04-04 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43519
+ * graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Use
+ POINTER_PLUS_EXPR for pointer types.
+
+ * gcc.dg/graphite/id-19.c: New.
+
+2010-04-04 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43519
* Makefile.in (graphite-clast-to-gimple.o): Depends on langhooks.h.
* graphite-clast-to-gimple.c: Include langhooks.h.
(max_signed_precision_type): New.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 6aab2a5521c..106ff7c5e7a 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1035,7 +1035,8 @@ graphite_create_new_loop_guard (sese region, edge entry_edge,
one = gmp_cst_to_tree (type, gmp_one);
value_clear (gmp_one);
- ub = fold_build2 (PLUS_EXPR, type, ub, one);
+ ub = fold_build2 (POINTER_TYPE_P (type) ? POINTER_PLUS_EXPR : PLUS_EXPR,
+ type, ub, one);
cond_expr = fold_build2 (LT_EXPR, boolean_type_node, lb, ub);
exit_edge = create_empty_if_region_on_edge (entry_edge, cond_expr);
diff --git a/gcc/testsuite/gcc.dg/graphite/id-19.c b/gcc/testsuite/gcc.dg/graphite/id-19.c
new file mode 100644
index 00000000000..b0d626b816d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/id-19.c
@@ -0,0 +1,6 @@
+void byte_insert_op1 (unsigned char *loc, unsigned char *end)
+{
+ register unsigned char *pto = end + 1 + 2;
+ while (end != loc)
+ *--pto = *--end;
+}