diff options
author | Jan Hubicka <jh@suse.cz> | 2006-07-26 22:17:32 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2006-07-26 20:17:32 +0000 |
commit | 96fc428c75cc0b52a53f6f8231be83dd78dcec4e (patch) | |
tree | 067f3bb521f2fed42cb3fd52c2a69fe71a9ac756 /gcc/cgraphunit.c | |
parent | 88c4be5e484663d65d6e95c07e49d91dfa36f57e (diff) | |
download | gcc-96fc428c75cc0b52a53f6f8231be83dd78dcec4e.zip gcc-96fc428c75cc0b52a53f6f8231be83dd78dcec4e.tar.gz gcc-96fc428c75cc0b52a53f6f8231be83dd78dcec4e.tar.bz2 |
re PR tree-optimization/27882 (segfault in ipa-inline.c, if (e->callee->local.disregard_inline_limits)
PR tree-optimization/27882
* cgraph.c (cgraph_remove_node): Clear needed, reachable, next, previous
and decl fields.
* cgraphunit.c (cgraph_reset_node): Expect cgraph_remove_node to kill
next pointer
(cgraph_analyze_compilation_unit): Likewise.
* ipa.c (cgraph_remove_unreachable_nodes): Likewise.
* ipa-inline.c (cgraph_decide_recursive_inlining): Likewise.
(cgraph_early_inlinine): Make order garbage collected.
* Makefile.in (gt-ipa-inline): New garbagecollected file.
From-SVN: r115763
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index db44cb8..606cd75 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -419,11 +419,14 @@ cgraph_reset_node (struct cgraph_node *node) if (!flag_unit_at_a_time) { - struct cgraph_node *n; + struct cgraph_node *n, *next; - for (n = cgraph_nodes; n; n = n->next) - if (n->global.inlined_to == node) - cgraph_remove_node (n); + for (n = cgraph_nodes; n; n = next) + { + next = n->next; + if (n->global.inlined_to == node) + cgraph_remove_node (n); + } } cgraph_node_remove_callees (node); @@ -1009,7 +1012,7 @@ process_function_and_variable_attributes (struct cgraph_node *first, void cgraph_finalize_compilation_unit (void) { - struct cgraph_node *node; + struct cgraph_node *node, *next; /* Keep track of already processed nodes when called multiple times for intermodule optimization. */ static struct cgraph_node *first_analyzed; @@ -1091,9 +1094,10 @@ cgraph_finalize_compilation_unit (void) if (cgraph_dump_file) fprintf (cgraph_dump_file, "\nReclaiming functions:"); - for (node = cgraph_nodes; node != first_analyzed; node = node->next) + for (node = cgraph_nodes; node != first_analyzed; node = next) { tree decl = node->decl; + next = node->next; if (node->local.finalized && !DECL_SAVED_TREE (decl)) cgraph_reset_node (node); |