aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2005-03-18 18:15:02 +0000
committerJan Hubicka <jh@suse.cz>2005-03-18 18:15:02 +0000
commit53778b39db16b749125f5af10f6f1b99099e3d53 (patch)
tree87be83ade66699980497ce9028927da94a9124aa /gcc/varasm.c
parentd8767cb516149bf2e4bdc5348628a9cfd1eb1582 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_0-branch@96693 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 953d54a7dd5..5ad57649b8a 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -4378,17 +4378,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)