Commit e45ade7e by Tobias Grosser Committed by Tobias Grosser

re PR middle-end/38084 ([graphite] ICE : in build_graphite_scops, at graphite.c:1829)

2008-12-09 Tobias Grosser  <grosser@fim.uni-passau.de>

	PR middle-end/38084
	Fix testsuite/gfortran.dg/graphite/id-3.f90.
	* graphite.c (scopdet_basic_block_info): Fix bug that found some
	regions more than once.
	* testsuite/gfortran.dg/graphite/id-3.f90: New.
	* gcc/testsuite/gcc.dg/graphite/pr38084.c: New.

From-SVN: r142578
parent b16ef779
2008-12-09 Tobias Grosser <grosser@fim.uni-passau.de>
PR middle-end/38084
Fix testsuite/gfortran.dg/graphite/id-3.f90.
* graphite.c (scopdet_basic_block_info): Fix bug that found some
regions more than once.
* testsuite/gfortran.dg/graphite/id-3.f90: New.
* gcc/testsuite/gcc.dg/graphite/pr38084.c: New.
2008-12-09 Ben Elliston <bje@au.ibm.com>
* config/dfp-bit.c (DFP_TO_INT): Remove unnecessary cast.
......@@ -1318,7 +1318,7 @@ scopdet_basic_block_info (basic_block bb, VEC (sd_region, heap) **scops,
case GBB_LOOP_MULT_EXIT_HEADER:
{
/* XXX: For now we just do not join loops with multiple exits. If the
/* XXX: For now we just do not join loops with multiple exits. If the
exits lead to the same bb it may be possible to join the loop. */
VEC (sd_region, heap) *tmp_scops = VEC_alloc (sd_region, heap, 3);
VEC (edge, heap) *exits = get_loop_exit_edges (loop);
......@@ -1326,28 +1326,27 @@ scopdet_basic_block_info (basic_block bb, VEC (sd_region, heap) **scops,
int i;
build_scops_1 (bb, &tmp_scops, loop);
/* Start at all bbs dominated by a loop exit that only exists in this
loop. */
/* Scan the code dominated by this loop. This means all bbs, that are
are dominated by a bb in this loop, but are not part of this loop.
The easiest case:
- The loop exit destination is dominated by the exit sources.
TODO: We miss here the more complex cases:
- The exit destinations are dominated by another bb inside the
loop.
- The loop dominates bbs, that are not exit destinations. */
for (i = 0; VEC_iterate (edge, exits, i, e); i++)
if (e->src->loop_father == loop)
{
VEC (basic_block, heap) *dominated;
basic_block b;
int j;
dominated = get_dominated_by (CDI_DOMINATORS, e->src);
for (j = 0; VEC_iterate (basic_block, dominated, j, b); j++)
/* Loop exit. */
if (loop_depth (find_common_loop (loop, b->loop_father))
< loop_depth (loop))
{
/* Pass loop_outer to recognize b as loop header in
build_scops_1. */
if (b->loop_father->header == b)
build_scops_1 (b, &tmp_scops, loop_outer (b->loop_father));
else
build_scops_1 (b, &tmp_scops, b->loop_father);
}
if (e->src->loop_father == loop
&& dominated_by_p (CDI_DOMINATORS, e->dest, e->src))
{
/* Pass loop_outer to recognize e->dest as loop header in
build_scops_1. */
if (e->dest->loop_father->header == e->dest)
build_scops_1 (e->dest, &tmp_scops,
loop_outer (e->dest->loop_father));
else
build_scops_1 (e->dest, &tmp_scops, e->dest->loop_father);
}
result.next = NULL;
......
/* { dg-options "-O3 -fgraphite-identity" } */
typedef struct {
unsigned int avail_out;
void *state;
} stream;
typedef struct {
stream* test;
int num;
} state_in;
int test_in ( stream *test, int action )
{
state_in* tst;
if (test == ((void *)0)) return (-2);
if (tst == ((void *)0)) return (-2);
if (tst->test != test) return (-2);
jump_here:
switch (tst->num) {
case 1:
return (-1);
case 2:
if (action == 0) {
}
if (action == 1) {
goto jump_here;
}
}
return 0;
}
! { dg-options "-O2 -fgraphite-identity" }
subroutine gentrs (ptrst, ncls, xmin, dcls, xdont, ndon)
do icls1 = 1, ncls
prec: do
select case (isns)
case (-1)
do icls = icls1, 1, -1
enddo
case (+1)
do icls = icls1, ncls
if (xale > rtrst (icls1, icls)) then
endif
enddo
end select
enddo prec
enddo
contains
real function genuni (jsee)
end function genuni
end subroutine gentrs
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