Commit d7bd989c by Steven Bosscher

re PR tree-optimization/55191 (ICE in compute_antic at tree-ssa-pre.c:2511)

gcc/
	PR tree-optimization/55191
	* cfganal.c (connect_infinite_loops_to_exit): Call dfs_deadend here.
	(flow_dfs_compute_reverse_execute): Don't call it here.

testsuite/
	PR tree-optimization/55191
	* gcc.dg/pr55191.c: New test.

From-SVN: r193341
parent 2a86dbb7
2012-11-08 Steven Bosscher <steven@gcc.gnu.org>
PR tree-optimization/55191
* cfganal.c (connect_infinite_loops_to_exit): Call dfs_deadend here.
(flow_dfs_compute_reverse_execute): Don't call it here.
2012-11-08 Jakub Jelinek <jakub@redhat.com> 2012-11-08 Jakub Jelinek <jakub@redhat.com>
PR debug/53145 PR debug/53145
...@@ -452,6 +452,7 @@ void ...@@ -452,6 +452,7 @@ void
connect_infinite_loops_to_exit (void) connect_infinite_loops_to_exit (void)
{ {
basic_block unvisited_block = EXIT_BLOCK_PTR; basic_block unvisited_block = EXIT_BLOCK_PTR;
basic_block deadend_block;
struct depth_first_search_dsS dfs_ds; struct depth_first_search_dsS dfs_ds;
/* Perform depth-first search in the reverse graph to find nodes /* Perform depth-first search in the reverse graph to find nodes
...@@ -467,8 +468,9 @@ connect_infinite_loops_to_exit (void) ...@@ -467,8 +468,9 @@ connect_infinite_loops_to_exit (void)
if (!unvisited_block) if (!unvisited_block)
break; break;
make_edge (unvisited_block, EXIT_BLOCK_PTR, EDGE_FAKE); deadend_block = dfs_find_deadend (unvisited_block);
flow_dfs_compute_reverse_add_bb (&dfs_ds, unvisited_block); make_edge (deadend_block, EXIT_BLOCK_PTR, EDGE_FAKE);
flow_dfs_compute_reverse_add_bb (&dfs_ds, deadend_block);
} }
flow_dfs_compute_reverse_finish (&dfs_ds); flow_dfs_compute_reverse_finish (&dfs_ds);
...@@ -958,7 +960,7 @@ flow_dfs_compute_reverse_execute (depth_first_search_ds data, ...@@ -958,7 +960,7 @@ flow_dfs_compute_reverse_execute (depth_first_search_ds data,
/* Determine if there are unvisited basic blocks. */ /* Determine if there are unvisited basic blocks. */
FOR_BB_BETWEEN (bb, last_unvisited, NULL, prev_bb) FOR_BB_BETWEEN (bb, last_unvisited, NULL, prev_bb)
if (!bitmap_bit_p (data->visited_blocks, bb->index)) if (!bitmap_bit_p (data->visited_blocks, bb->index))
return dfs_find_deadend (bb); return bb;
return NULL; return NULL;
} }
......
2012-11-08 Steven Bosscher <steven@gcc.gnu.org>
PR tree-optimization/55191
* gcc.dg/pr55191.c: New test.
2012-11-08 Jakub Jelinek <jakub@redhat.com> 2012-11-08 Jakub Jelinek <jakub@redhat.com>
PR debug/54499 PR debug/54499
......
/* PR tree-optimization/55191 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
int a, b;
void f(void)
{
b = a || b;
for(a = 0; a < 2; a++);
while(1);
}
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