Patchwork [3/5] Remove continue from loop, add one more assert.

login
register
mail settings
Submitter Sebastian Pop
Date May 24, 2011, 6:51 p.m.
Message ID <1306263072-5821-4-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/97197/
State New
Headers show

Comments

Sebastian Pop - May 24, 2011, 6:51 p.m.
2011-05-24  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-dependences.c (build_alias_set_powerset): Remove
	continue from loop, add one more assert.
---
 gcc/ChangeLog.graphite     |    5 +++++
 gcc/graphite-dependences.c |   15 ++++++---------
 2 files changed, 11 insertions(+), 9 deletions(-)

Patch

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index af1c764..afcac69 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@ 
 2011-05-24  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite-dependences.c (build_alias_set_powerset): Remove
+	continue from loop, add one more assert.
+
+2011-05-24  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-dependences.c (graphite_outer_subscript_bound): Remove
 	unused parameter.
 	* graphite-dependences.h (graphite_outer_subscript_bound): Same.
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index 87a8bef..cf68507 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -171,19 +171,16 @@  build_alias_set_powerset (ppl_Pointset_Powerset_C_Polyhedron_t alias_powerset,
 {
   ppl_dimension_type *ds;
   ppl_dimension_type access_dim;
-  unsigned i, pos = 0;
+  unsigned i, pos;
 
   ppl_Pointset_Powerset_C_Polyhedron_space_dimension (alias_powerset,
 						      &access_dim);
-  ds = XNEWVEC (ppl_dimension_type, access_dim-1);
-  for (i = 0; i < access_dim; i++)
-    {
-      if (i == alias_dim)
-	continue;
+  ds = XNEWVEC (ppl_dimension_type, access_dim - 1);
+  gcc_assert (alias_dim < access_dim);
 
-      ds[pos] = i;
-      pos++;
-    }
+  for (pos = 0, i = 0; i < access_dim; i++)
+    if (i != alias_dim)
+      ds[pos++] = i;
 
   ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions (alias_powerset,
 							      ds,