aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-10-30 14:30:43 +0100
committerJan Hubicka <jh@suse.cz>2020-10-30 14:30:43 +0100
commitaa701610e51ca9e15573ba080cb93ef726252cfc (patch)
treedf843230a64856ebefdf8d5a021f3ee7d11851b5 /gcc/cgraph.c
parent40cb3f8ac875c6cf6610a5f93da571cfdd2a1513 (diff)
downloadgcc-aa701610e51ca9e15573ba080cb93ef726252cfc.zip
gcc-aa701610e51ca9e15573ba080cb93ef726252cfc.tar.gz
gcc-aa701610e51ca9e15573ba080cb93ef726252cfc.tar.bz2
Fix thunk info WRT PCH
PR pch/97593 * cgraph.c (cgraph_node::create_thunk): Register thunk as early during parsing. * cgraphunit.c (analyze_functions): Call thunk_info::process_early_thunks. * symtab-thunks.cc (struct unprocessed_thunk): New struct. (thunks): New static variable. (thunk_info::register_early): New member function. (thunk_info::process_early_thunks): New member function. * symtab-thunks.h (thunk_info::register_early): Declare. (thunk_info::process_early_thunks): Declare.
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index d1a773d..9129bcf 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -633,13 +633,20 @@ cgraph_node::create_thunk (tree alias, tree, bool this_adjusting,
node->thunk = true;
node->definition = true;
- thunk_info *i = thunk_info::get_create (node);
+ thunk_info *i;
+ thunk_info local_info;
+ if (symtab->state < CONSTRUCTION)
+ i = &local_info;
+ else
+ i = thunk_info::get_create (node);
i->fixed_offset = fixed_offset;
i->virtual_value = virtual_value;
i->indirect_offset = indirect_offset;
i->alias = real_alias;
i->this_adjusting = this_adjusting;
i->virtual_offset_p = virtual_offset != NULL;
+ if (symtab->state < CONSTRUCTION)
+ i->register_early (node);
return node;
}