[Bug tree-optimization/41101] [4.4/4.5 Regression] ICE in compute_antic, at tree-ssa-pre.c:2419
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Sep 6 17:42:00 GMT 2009
------- Comment #18 from rguenth at gcc dot gnu dot org 2009-09-06 17:41 -------
Do you mean sth like the following? Simply assuming that the maximal-set is
all ones and obviously translating all ones also results in all ones.
Index: gcc/tree-ssa-pre.c
===================================================================
--- gcc/tree-ssa-pre.c (revision 151459)
+++ gcc/tree-ssa-pre.c (working copy)
@@ -2201,49 +2201,45 @@ compute_antic_aux (basic_block block, bo
{
VEC(basic_block, heap) * worklist;
size_t i;
- basic_block bprime, first;
+ basic_block bprime, first = NULL;
worklist = VEC_alloc (basic_block, heap, EDGE_COUNT (block->succs));
FOR_EACH_EDGE (e, ei, block->succs)
- VEC_quick_push (basic_block, worklist, e->dest);
- first = VEC_index (basic_block, worklist, 0);
-
- if (phi_nodes (first))
{
- bitmap_set_t from = ANTIC_IN (first);
-
- if (!BB_VISITED (first))
- from = maximal_set;
- phi_translate_set (ANTIC_OUT, from, block, first);
+ if (!first
+ && BB_VISITED (e->dest))
+ first = e->dest;
+ else if (BB_VISITED (e->dest))
+ VEC_quick_push (basic_block, worklist, e->dest);
+ }
+
+ /* Of multiple successors we have to have visited one already. */
+ if (!first)
+ {
+ SET_BIT (changed_blocks, block->index);
+ BB_VISITED (block) = 0;
+ BB_DEFERRED (block) = 1;
+ changed = true;
+ VEC_free (basic_block, heap, worklist);
+ goto maybe_dump_sets;
}
+
+ if (phi_nodes (first))
+ phi_translate_set (ANTIC_OUT, ANTIC_IN (first), block, first);
else
- {
- if (!BB_VISITED (first))
- bitmap_set_copy (ANTIC_OUT, maximal_set);
- else
- bitmap_set_copy (ANTIC_OUT, ANTIC_IN (first));
- }
+ bitmap_set_copy (ANTIC_OUT, ANTIC_IN (first));
- for (i = 1; VEC_iterate (basic_block, worklist, i, bprime); i++)
+ for (i = 0; VEC_iterate (basic_block, worklist, i, bprime); i++)
{
if (phi_nodes (bprime))
{
bitmap_set_t tmp = bitmap_set_new ();
- bitmap_set_t from = ANTIC_IN (bprime);
-
- if (!BB_VISITED (bprime))
- from = maximal_set;
- phi_translate_set (tmp, from, block, bprime);
+ phi_translate_set (tmp, ANTIC_IN (bprime), block, bprime);
bitmap_set_and (ANTIC_OUT, tmp);
bitmap_set_free (tmp);
}
else
- {
- if (!BB_VISITED (bprime))
- bitmap_set_and (ANTIC_OUT, maximal_set);
- else
- bitmap_set_and (ANTIC_OUT, ANTIC_IN (bprime));
- }
+ bitmap_set_and (ANTIC_OUT, ANTIC_IN (bprime));
}
VEC_free (basic_block, heap, worklist);
}
Now obviously I'm not convinced we'll not defer blocks forever because
we can't seed one with the maximal set ...
Minimally tested with this testcase and tree-ssa.exp.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41101
More information about the Gcc-bugs
mailing list