Commit 8a1da634 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/52835 (-O3 wrongly optimizes loop __builtin_memcpy away)

	PR tree-optimization/52835
	* tree-data-ref.c (build_rdg): Return NULL if
	compute_data_dependences_for_loop failed.

	* gfortran.dg/pr52835.f90: New test.

From-SVN: r186101
parent 1d3aa466
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.
......
! 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" } }
......@@ -5109,20 +5109,19 @@ build_rdg (struct loop *loop,
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment