summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-parloops.c11
-rw-r--r--gcc/tree-predcom.c13
3 files changed, 26 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d252a5ab351..af7119b234e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-25 Andrey Belevantsev <abel@ispras.ru>
+
+ * tree-predcom.c (tree_predictive_commoning_loop): Bail out when
+ compute_data_dependences_for_loop returns false.
+ * tree-parloops.c (loop_parallel_p): Likewise.
+
2012-01-25 Richard Guenther <rguenther@suse.de>
* tree.h (get_pointer_alignment_1): Declare.
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 339ddcc18a5..c5b76559ba0 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -387,8 +387,14 @@ loop_parallel_p (struct loop *loop, struct obstack * parloop_obstack)
datarefs = VEC_alloc (data_reference_p, heap, 10);
dependence_relations = VEC_alloc (ddr_p, heap, 10 * 10);
loop_nest = VEC_alloc (loop_p, heap, 3);
- compute_data_dependences_for_loop (loop, true, &loop_nest, &datarefs,
- &dependence_relations);
+ if (! compute_data_dependences_for_loop (loop, true, &loop_nest, &datarefs,
+ &dependence_relations))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " FAILED: cannot analyze data dependencies\n");
+ ret = false;
+ goto end;
+ }
if (dump_file && (dump_flags & TDF_DETAILS))
dump_data_dependence_relations (dump_file, dependence_relations);
@@ -405,6 +411,7 @@ loop_parallel_p (struct loop *loop, struct obstack * parloop_obstack)
fprintf (dump_file,
" FAILED: data dependencies exist across iterations\n");
+ end:
VEC_free (loop_p, heap, loop_nest);
free_dependence_relations (dependence_relations);
free_data_refs (datarefs);
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 751bdebfa8a..64198788967 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -2476,8 +2476,17 @@ tree_predictive_commoning_loop (struct loop *loop)
datarefs = VEC_alloc (data_reference_p, heap, 10);
dependences = VEC_alloc (ddr_p, heap, 10);
loop_nest = VEC_alloc (loop_p, heap, 3);
- compute_data_dependences_for_loop (loop, true, &loop_nest, &datarefs,
- &dependences);
+ if (! compute_data_dependences_for_loop (loop, true, &loop_nest, &datarefs,
+ &dependences))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "Cannot analyze data dependencies\n");
+ VEC_free (loop_p, heap, loop_nest);
+ free_data_refs (datarefs);
+ free_dependence_relations (dependences);
+ return false;
+ }
+
if (dump_file && (dump_flags & TDF_DETAILS))
dump_data_dependence_relations (dump_file, dependences);