Patchwork [33/65] Fix flipped condition using mpz_sgn.

login
register
mail settings
Submitter Sebastian Pop
Date Aug. 2, 2010, 8:20 p.m.
Message ID <1280780438-17543-34-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/60630/
State New
Headers show

Comments

Sebastian Pop - Aug. 2, 2010, 8:20 p.m.
From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>

2010-07-15  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>

	* graphite-cloog-util.c
	(cloog_matrix_to_ppl_constraint): Fix flipped condition.
	* graphite-poly.c
	(psct_scattering_dim_for_loop_depth): Same.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162207 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog             |    7 +++++++
 gcc/ChangeLog.graphite    |    7 +++++++
 gcc/graphite-cloog-util.c |    2 +-
 gcc/graphite-poly.c       |    2 +-
 4 files changed, 16 insertions(+), 2 deletions(-)

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b0f30f1..c93abbf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@ 
 2010-08-02  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
 
+	* graphite-cloog-util.c
+	(cloog_matrix_to_ppl_constraint): Fix flipped condition.
+	* graphite-poly.c
+	(psct_scattering_dim_for_loop_depth): Same.
+
+2010-08-02  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
+
 	* graphite-cloog-util.h: Added cloog.h.
 	* graphite-blocking.c: Removed cloog.h.
 	* graphite-dependences.c: Same.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index fa59c75..806d67e 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,10 @@ 
+2010-07-15  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
+
+	* graphite-cloog-util.c
+	(cloog_matrix_to_ppl_constraint): Fix flipped condition.
+	* graphite-poly.c
+	(psct_scattering_dim_for_loop_depth): Same.
+
 2010-07-07  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* gfortran.dg/graphite/id-20.f: New.
diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c
index 21a7872..33ee5cf 100644
--- a/gcc/graphite-cloog-util.c
+++ b/gcc/graphite-cloog-util.c
@@ -187,7 +187,7 @@  cloog_matrix_to_ppl_constraint (CloogMatrix *matrix, int row)
   ppl_Linear_Expression_add_to_inhomogeneous (expr, coef);
   ppl_delete_Coefficient (coef);
 
-  if (mpz_sgn (matrix->p[row][0]))
+  if (mpz_sgn (matrix->p[row][0]) == 0)
     ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_EQUAL);
   else
     ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 67b9384..7d33aa8 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -1018,7 +1018,7 @@  psct_scattering_dim_for_loop_depth (poly_bb_p pbb, graphite_dim_t loop_depth)
       ppl_Linear_Expression_coefficient (expr, iter, coef);
       ppl_Coefficient_to_mpz_t (coef, val);
 
-      if (mpz_sgn (val))
+      if (mpz_sgn (val) == 0)
 	{
 	  ppl_delete_Linear_Expression (expr);
 	  continue;