This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/16967] Iterating gcse.c CPROP and PRE does not reach a fixed point
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Apr 2006 20:53:10 -0000
- Subject: [Bug rtl-optimization/16967] Iterating gcse.c CPROP and PRE does not reach a fixed point
- References: <bug-16967-280@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from steven at gcc dot gnu dot org 2006-04-20 20:53 -------
I have tested this test case again with lcm.c patched with the patch below to
check for insertions on edges where an expression is already available. The
abort does not trigger.
The version of GCC that I patched and tested was extracted from SVN with the
following commands: svn co -r {"2004-08-10 15:10"} (etc.)
Index: lcm.c
===================================================================
--- lcm.c (revision 85749)
+++ lcm.c (working copy)
@@ -426,10 +426,6 @@ pre_edge_lcm (FILE *file ATTRIBUTE_UNUSE
dump_sbitmap_vector (file, "earliest", "", earliest, num_edges);
#endif
- sbitmap_vector_free (antout);
- sbitmap_vector_free (antin);
- sbitmap_vector_free (avout);
-
later = sbitmap_vector_alloc (num_edges, n_exprs);
/* Allocate an extra element for the exit block in the laterin vector. */
@@ -462,6 +458,32 @@ pre_edge_lcm (FILE *file ATTRIBUTE_UNUSE
}
#endif
+#if 1
+ {
+ sbitmap *avout_check;
+ sbitmap *insert_ = *insert;
+ int x;
+
+ avout_check = sbitmap_vector_alloc (num_edges, n_exprs);
+ sbitmap_vector_zero (avout_check, num_edges);
+
+ for (x = 0; x < num_edges; x++)
+ {
+ basic_block bb = INDEX_EDGE_PRED_BB (edge_list, x);
+ if (bb->index < 0)
+ continue;
+ sbitmap_copy (avout_check[x], avout[bb->index]);
+ sbitmap_a_and_b (avout_check[x], avout_check[x], insert_[x]);
+ if (sbitmap_first_set_bit (avout_check[x]) >= 0)
+ abort ();
+ }
+ }
+#endif
+
+ sbitmap_vector_free (antout);
+ sbitmap_vector_free (antin);
+ sbitmap_vector_free (avout);
+
return edge_list;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16967