diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 87d67a1..768de7d 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,13 @@
 2010-07-27  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
 
+	* graphite-cloog-util.c (oppose_constraint):
+	Extend loop counter's value range (CLOOG_ORG).
+	(cloog_matrix_to_ppl_constraint): Same.
+	(new_Constraint_System_from_Cloog_matrix): Same.
+	* graphite-cloog-compat.h (matrix_num_type): New.
+
+2010-07-27  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
+
 	* graphite.c (graphite_initialize): Do not initialize
 	CLooG and initialize the Parma Polyhedra Library
 	manually when using CLOOG_ORG.
diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
index c39b18e..03fc124 100644
--- a/gcc/graphite-cloog-compat.h
+++ b/gcc/graphite-cloog-compat.h
@@ -25,8 +25,10 @@ along with GCC; see the file COPYING3.  If not see
 /* Restore compatibility to CLooG Legacy.  */
 #ifdef CLOOG_ORG
 typedef const struct clast_expr *clast_name_p;
+typedef unsigned matrix_num_type;
 #else
 typedef const char *clast_name_p;
+typedef int matrix_num_type;
 #endif
 
 #ifdef CLOOG_ORG
diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c
index 1770458..5ea7c3c 100644
--- a/gcc/graphite-cloog-util.c
+++ b/gcc/graphite-cloog-util.c
@@ -57,7 +57,7 @@ ppl_Constrain_System_number_of_constraints (ppl_const_Constraint_System_t pcs)
 static void
 oppose_constraint (CloogMatrix *m, int row)
 {
-  int k;
+  matrix_num_type k;
 
   /* Do not oppose the first column: it is the eq/ineq one.  */
   for (k = 1; k < m->NbColumns; k++)
@@ -168,7 +168,7 @@ new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph)
 static ppl_Constraint_t
 cloog_matrix_to_ppl_constraint (CloogMatrix *matrix, int row)
 {
-  int j;
+  matrix_num_type j;
   ppl_Constraint_t cstr;
   ppl_Coefficient_t coef;
   ppl_Linear_Expression_t expr;
@@ -203,7 +203,7 @@ static void
 new_Constraint_System_from_Cloog_Matrix (ppl_Constraint_System_t *pcs,
 					 CloogMatrix *matrix)
 {
-  int i;
+  matrix_num_type i;
 
   ppl_new_Constraint_System (pcs);
 
