+2012-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/52835
+ * tree-data-ref.c (build_rdg): Return NULL if
+ compute_data_dependences_for_loop failed.
+
2012-04-03 Eric Botcazou <ebotcazou@adacore.com>
* varasm.c (initializer_constant_valid_for_bitfield_p): Return true
+2012-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/52835
+ * gfortran.dg/pr52835.f90: New test.
+
2012-04-03 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/aggr5.ads: New test.
--- /dev/null
+! PR tree-optimization/52835
+! { dg-do compile }
+! { dg-options "-O3 -fdump-tree-optimized" }
+
+subroutine foo (x, y, z, n)
+ integer :: n, i
+ real :: x(n), y(n), z(n)
+ do i = 1, n
+ z(i) = 0.0
+ y(i) = 0.0
+ call bar (y(i), z(i), x(i))
+ end do
+end subroutine
+
+! { dg-final { scan-tree-dump "bar " "optimized" } }
+! { dg-final { cleanup-tree-dump "optimized" } }
VEC (data_reference_p, heap) **datarefs)
{
struct graph *rdg = NULL;
- VEC (gimple, heap) *stmts = VEC_alloc (gimple, heap, 10);
- compute_data_dependences_for_loop (loop, false, loop_nest, datarefs,
- dependence_relations);
-
- if (known_dependences_p (*dependence_relations))
+ if (compute_data_dependences_for_loop (loop, false, loop_nest, datarefs,
+ dependence_relations)
+ && known_dependences_p (*dependence_relations))
{
+ VEC (gimple, heap) *stmts = VEC_alloc (gimple, heap, 10);
stmts_from_loop (loop, &stmts);
rdg = build_empty_rdg (VEC_length (gimple, stmts));
create_rdg_vertices (rdg, stmts);
create_rdg_edges (rdg, *dependence_relations);
+ VEC_free (gimple, heap, stmts);
}
- VEC_free (gimple, heap, stmts);
return rdg;
}