mirror of git://gcc.gnu.org/git/gcc.git
re PR tree-optimization/69823 (internal compiler error: in create_pw_aff_from_tree, at graphite-sese-to-poly.c:445)
2017-02-09 Richard Biener <rguenther@suse.de> PR tree-optimization/69823 * graphite-scop-detection.c (scop_detection::harmful_loop_in_region): Properly enumerate all BBs in the region. Use auto_vec/auto_bitmap. * gcc.dg/graphite/pr69823.c: New testcase. From-SVN: r245295
This commit is contained in:
parent
3a9abd2302
commit
9c0c77d279
|
|
@ -1,3 +1,9 @@
|
|||
2017-02-09 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/69823
|
||||
* graphite-scop-detection.c (scop_detection::harmful_loop_in_region):
|
||||
Properly enumerate all BBs in the region. Use auto_vec/auto_bitmap.
|
||||
|
||||
2017-02-09 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||
|
||||
* config/arc/arc-c.def: Add __NPS400__ definition.
|
||||
|
|
|
|||
|
|
@ -1062,35 +1062,18 @@ scop_detection::harmful_loop_in_region (sese_l scop) const
|
|||
print_sese (dump_file, scop));
|
||||
gcc_assert (dominated_by_p (CDI_DOMINATORS, exit_bb, entry_bb));
|
||||
|
||||
int depth = bb_dom_dfs_in (CDI_DOMINATORS, exit_bb)
|
||||
- bb_dom_dfs_in (CDI_DOMINATORS, entry_bb);
|
||||
auto_vec<basic_block> worklist;
|
||||
auto_bitmap loops;
|
||||
|
||||
gcc_assert (depth > 0);
|
||||
|
||||
vec<basic_block> dom
|
||||
= get_dominated_to_depth (CDI_DOMINATORS, entry_bb, depth);
|
||||
int i;
|
||||
basic_block bb;
|
||||
bitmap loops = BITMAP_ALLOC (NULL);
|
||||
FOR_EACH_VEC_ELT (dom, i, bb)
|
||||
worklist.safe_push (entry_bb);
|
||||
while (! worklist.is_empty ())
|
||||
{
|
||||
basic_block bb = worklist.pop ();
|
||||
DEBUG_PRINT (dp << "Visiting bb_" << bb->index << "\n");
|
||||
|
||||
/* We don't want to analyze any bb outside sese. */
|
||||
if (!dominated_by_p (CDI_POST_DOMINATORS, bb, exit_bb))
|
||||
continue;
|
||||
|
||||
/* Basic blocks dominated by the scop->exit are not in the scop. */
|
||||
if (bb != exit_bb && dominated_by_p (CDI_DOMINATORS, bb, exit_bb))
|
||||
continue;
|
||||
|
||||
/* The basic block should not be part of an irreducible loop. */
|
||||
if (bb->flags & BB_IRREDUCIBLE_LOOP)
|
||||
{
|
||||
dom.release ();
|
||||
BITMAP_FREE (loops);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
/* Check for unstructured control flow: CFG not generated by structured
|
||||
if-then-else. */
|
||||
|
|
@ -1114,13 +1097,14 @@ scop_detection::harmful_loop_in_region (sese_l scop) const
|
|||
any loop fully contained in the scop: other bbs are checked below
|
||||
in loop_is_valid_in_scop. */
|
||||
if (harmful_stmt_in_bb (scop, bb))
|
||||
{
|
||||
dom.release ();
|
||||
BITMAP_FREE (loops);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (bb != exit_bb)
|
||||
for (basic_block dom = first_dom_son (CDI_DOMINATORS, bb);
|
||||
dom;
|
||||
dom = next_dom_son (CDI_DOMINATORS, dom))
|
||||
worklist.safe_push (dom);
|
||||
}
|
||||
|
||||
/* Go through all loops and check that they are still valid in the combined
|
||||
|
|
@ -1133,15 +1117,9 @@ scop_detection::harmful_loop_in_region (sese_l scop) const
|
|||
gcc_assert (loop->num == (int) j);
|
||||
|
||||
if (!loop_is_valid_in_scop (loop, scop))
|
||||
{
|
||||
dom.release ();
|
||||
BITMAP_FREE (loops);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
dom.release ();
|
||||
BITMAP_FREE (loops);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
2017-02-09 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/69823
|
||||
* gcc.dg/graphite/pr69823.c: New testcase.
|
||||
|
||||
2017-02-08 Pat Haugen <pthaugen@us.ibm.com>
|
||||
|
||||
PR target/78604
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -floop-nest-optimize" } */
|
||||
|
||||
void
|
||||
foo (int c, int *p, int *a1, int *a2, int *a3)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (c)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
a1[i] = 1;
|
||||
|
||||
if (*p)
|
||||
*a2 = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
a3[i] = 0;
|
||||
}
|
||||
Loading…
Reference in New Issue