This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/27882] [4.1/4.2 regression] segfault in ipa-inline.c, if (e->callee->local.disregard_inline_limits
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2006 13:31:57 -0000
- Subject: [Bug tree-optimization/27882] [4.1/4.2 regression] segfault in ipa-inline.c, if (e->callee->local.disregard_inline_limits
- References: <bug-27882-12387@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #23 from rguenth at gcc dot gnu dot org 2006-07-19 13:31 -------
I have a patch:
Index: ipa-inline.c
===================================================================
--- ipa-inline.c (revision 115554)
+++ ipa-inline.c (working copy)
@@ -1133,6 +1133,7 @@ cgraph_early_inlining (void)
struct cgraph_node **order =
xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *));
int i;
+ htab_t cycles;
if (sorrycount || errorcount)
return;
@@ -1142,6 +1143,8 @@ cgraph_early_inlining (void)
#endif
nnodes = cgraph_postorder (order);
+ cycles = htab_create (7, htab_hash_pointer, htab_eq_pointer, NULL);
+ cgraph_find_cycles (cgraph_nodes, cycles);
for (i = nnodes - 1; i >= 0; i--)
{
node = order[i];
@@ -1149,10 +1152,13 @@ cgraph_early_inlining (void)
&& (node->needed || node->reachable)
&& node->callers)
{
- if (cgraph_decide_inlining_incrementally (node, true))
+ if (cgraph_decide_inlining_incrementally (node, true)
+ /* Avoid collecting if inlining in a cycle. */
+ && !htab_find (cycles, node))
ggc_collect ();
}
}
+ htab_delete (cycles);
cgraph_remove_unreachable_nodes (true, dump_file);
#ifdef ENABLE_CHECKING
for (node = cgraph_nodes; node; node = node->next)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27882