diff options
author | Jan Hubicka <jh@suse.cz> | 2005-03-18 15:57:10 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2005-03-18 14:57:10 +0000 |
commit | 45676d2b6ca5a09e21e51a0527c3381fcb161cde (patch) | |
tree | 437a96bf5c4ffbdcea6395eb75991df4b2b70ed1 /gcc | |
parent | 625da0db0f79c2d754857d772bb59aba0a3ea1cb (diff) | |
download | gcc-45676d2b6ca5a09e21e51a0527c3381fcb161cde.zip gcc-45676d2b6ca5a09e21e51a0527c3381fcb161cde.tar.gz gcc-45676d2b6ca5a09e21e51a0527c3381fcb161cde.tar.bz2 |
re PR middle-end/20225 (ICE during GC)
PR middle-end/20225
* cgraph.c (cgraph_mark_reachable_node): Assert that it is not called
too late.
* varasm.c (find_decl_and_mark_needed): Mark needed only when not
called too late.
From-SVN: r96685
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cgraph.c | 1 | ||||
-rw-r--r-- | gcc/varasm.c | 25 |
3 files changed, 24 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4a3785..acc6a13 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2005-03-18 Jan Hubicka <jh@suse.cz> + + PR middle-end/20225 + * cgraph.c (cgraph_mark_reachable_node): Assert that it is not called + too late. + * varasm.c (find_decl_and_mark_needed): Mark needed only when not + called too late. + 2005-03-18 Kazu Hirata <kazu@cs.umass.edu> * tree-into-ssa.c (find_idf): Use VEC_quick_push instead of diff --git a/gcc/cgraph.c b/gcc/cgraph.c index dacc70d..c7475c1 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -469,6 +469,7 @@ cgraph_mark_reachable_node (struct cgraph_node *node) { notice_global_symbol (node->decl); node->reachable = 1; + gcc_assert (!cgraph_global_info_ready); node->next_needed = cgraph_nodes_queue; cgraph_nodes_queue = node; diff --git a/gcc/varasm.c b/gcc/varasm.c index 2f16f7e..5392dae 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -4360,17 +4360,22 @@ find_decl_and_mark_needed (tree decl, tree target) struct cgraph_node *fnode = NULL; struct cgraph_varpool_node *vnode = NULL; - if (TREE_CODE (decl) == FUNCTION_DECL) + /* C++ thunk emitting code produces aliases late in the game. + Avoid confusing cgraph code in that case. */ + if (!cgraph_global_info_ready) { - fnode = cgraph_node_for_asm (target); - if (fnode == NULL) - vnode = cgraph_varpool_node_for_asm (target); - } - else - { - vnode = cgraph_varpool_node_for_asm (target); - if (vnode == NULL) - fnode = cgraph_node_for_asm (target); + if (TREE_CODE (decl) == FUNCTION_DECL) + { + fnode = cgraph_node_for_asm (target); + if (fnode == NULL) + vnode = cgraph_varpool_node_for_asm (target); + } + else + { + vnode = cgraph_varpool_node_for_asm (target); + if (vnode == NULL) + fnode = cgraph_node_for_asm (target); + } } if (fnode) |