aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoman Gareev <gareevroman@gmail.com>2014-06-29 12:16:11 +0000
committerRoman Gareev <romangareev@gcc.gnu.org>2014-06-29 12:16:11 +0000
commit516a84f7c0fef97317781cab65213ceef7d696df (patch)
tree0d0df88729931bdb6891e8ec57d2032d9223b4f3 /gcc
parentdb72d6061893ef8d127758474a79e2833bd3eef1 (diff)
downloadgcc-516a84f7c0fef97317781cab65213ceef7d696df.zip
gcc-516a84f7c0fef97317781cab65213ceef7d696df.tar.gz
gcc-516a84f7c0fef97317781cab65213ceef7d696df.tar.bz2
graphite-dependences.c (subtract_commutative_associative_deps): Add NULL checking of the following variables...
gcc/ * graphite-dependences.c (subtract_commutative_associative_deps): Add NULL checking of the following variables: must_raw_no_source, may_raw_no_source, must_war_no_source, may_war_no_source, must_waw_no_source, may_waw_no_source, must_raw, may_raw, must_war, may_war, must_waw, may_waw gcc/testsuite/gfortran.dg/graphite/pr59586.f: New testcase. From-SVN: r212122
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/graphite-dependences.c83
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/pr59586.f11
3 files changed, 86 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fc0a102..dcf5f15 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,15 @@
2014-06-29 Roman Gareev <gareevroman@gmail.com>
+ * graphite-dependences.c (subtract_commutative_associative_deps):
+ Add NULL checking of the following variables: must_raw_no_source,
+ may_raw_no_source, must_war_no_source, may_war_no_source,
+ must_waw_no_source, may_waw_no_source, must_raw, may_raw,
+ must_war, may_war, must_waw, may_waw
+
+ testsuite/gfortran.dg/graphite/pr59586.f: New testcase.
+
+2014-06-29 Roman Gareev <gareevroman@gmail.com>
+
* graphite-clast-to-gimple.c:
gloog is renamed to graphite_regenerate_ast_cloog.
gloog_error is renamed to graphite_regenerate_error.
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index 8c90c8e..e934d9a 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -424,24 +424,71 @@ subtract_commutative_associative_deps (scop_p scop,
&x_may_waw_no_source);
gcc_assert (res == 0);
- *must_raw = isl_union_map_subtract (*must_raw, x_must_raw);
- *may_raw = isl_union_map_subtract (*may_raw, x_may_raw);
- *must_raw_no_source = isl_union_map_subtract (*must_raw_no_source,
- x_must_raw_no_source);
- *may_raw_no_source = isl_union_map_subtract (*may_raw_no_source,
- x_may_raw_no_source);
- *must_war = isl_union_map_subtract (*must_war, x_must_war);
- *may_war = isl_union_map_subtract (*may_war, x_may_war);
- *must_war_no_source = isl_union_map_subtract (*must_war_no_source,
- x_must_war_no_source);
- *may_war_no_source = isl_union_map_subtract (*may_war_no_source,
- x_may_war_no_source);
- *must_waw = isl_union_map_subtract (*must_waw, x_must_waw);
- *may_waw = isl_union_map_subtract (*may_waw, x_may_waw);
- *must_waw_no_source = isl_union_map_subtract (*must_waw_no_source,
- x_must_waw_no_source);
- *may_waw_no_source = isl_union_map_subtract (*may_waw_no_source,
- x_may_waw_no_source);
+ if (must_raw)
+ *must_raw = isl_union_map_subtract (*must_raw, x_must_raw);
+ else
+ isl_union_map_free (x_must_raw);
+
+ if (may_raw)
+ *may_raw = isl_union_map_subtract (*may_raw, x_may_raw);
+ else
+ isl_union_map_free (x_may_raw);
+
+ if (must_raw_no_source)
+ *must_raw_no_source = isl_union_map_subtract (*must_raw_no_source,
+ x_must_raw_no_source);
+ else
+ isl_union_map_free (x_must_raw_no_source);
+
+ if (may_raw_no_source)
+ *may_raw_no_source = isl_union_map_subtract (*may_raw_no_source,
+ x_may_raw_no_source);
+ else
+ isl_union_map_free (x_may_raw_no_source);
+
+ if (must_war)
+ *must_war = isl_union_map_subtract (*must_war, x_must_war);
+ else
+ isl_union_map_free (x_must_war);
+
+ if (may_war)
+ *may_war = isl_union_map_subtract (*may_war, x_may_war);
+ else
+ isl_union_map_free (x_may_war);
+
+ if (must_war_no_source)
+ *must_war_no_source = isl_union_map_subtract (*must_war_no_source,
+ x_must_war_no_source);
+ else
+ isl_union_map_free (x_must_war_no_source);
+
+ if (may_war_no_source)
+ *may_war_no_source = isl_union_map_subtract (*may_war_no_source,
+ x_may_war_no_source);
+ else
+ isl_union_map_free (x_may_war_no_source);
+
+ if (must_waw)
+ *must_waw = isl_union_map_subtract (*must_waw, x_must_waw);
+ else
+ isl_union_map_free (x_must_waw);
+
+ if (may_waw)
+ *may_waw = isl_union_map_subtract (*may_waw, x_may_waw);
+ else
+ isl_union_map_free (x_may_waw);
+
+ if (must_waw_no_source)
+ *must_waw_no_source = isl_union_map_subtract (*must_waw_no_source,
+ x_must_waw_no_source);
+ else
+ isl_union_map_free (x_must_waw_no_source);
+
+ if (may_waw_no_source)
+ *may_waw_no_source = isl_union_map_subtract (*may_waw_no_source,
+ x_may_waw_no_source);
+ else
+ isl_union_map_free (x_may_waw_no_source);
}
isl_union_map_free (original);
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr59586.f b/gcc/testsuite/gfortran.dg/graphite/pr59586.f
new file mode 100644
index 0000000..f33a1b1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/pr59586.f
@@ -0,0 +1,11 @@
+! { dg-additional-options "-Ofast -floop-parallelize-all" }
+
+ subroutine subsm ( n, x, xp, xx)
+ integer n, m, x(n),xp(n), xx(n), gg(n), dd_p
+ do 55 i=1, n
+ dd_p = dd_p + (x(i) - xx(i))*gg(i)
+ 55 continue
+ if ( dd_p .gt. 0 ) then
+ call dcopy( n, xp, 1, x, 1 )
+ endif
+ end