Commit 532df904 by Richard Guenther Committed by Richard Biener

re PR lto/42762 (ICE in get_resolution() when compiling a C++ program with -flto…

re PR lto/42762 (ICE in get_resolution() when compiling a C++ program with -flto -fuse-linker-plugin)

2010-02-05  Richard Guenther  <rguenther@suse.de>

	PR lto/42762
	* lto-streamer-in.c (get_resolution): Deal with references
	to undefined functions.

From-SVN: r156520
parent 5c95f07b
2010-02-05 Richard Guenther <rguenther@suse.de> 2010-02-05 Richard Guenther <rguenther@suse.de>
PR lto/42762
* lto-streamer-in.c (get_resolution): Deal with references
to undefined functions.
2010-02-05 Richard Guenther <rguenther@suse.de>
* tree-ssa-ccp.c (get_symbol_constant_value): Strip all * tree-ssa-ccp.c (get_symbol_constant_value): Strip all
conversions. conversions.
(fold_const_aggregate_ref): Likewise. (fold_const_aggregate_ref): Likewise.
......
...@@ -1515,12 +1515,15 @@ get_resolution (struct data_in *data_in, unsigned index) ...@@ -1515,12 +1515,15 @@ get_resolution (struct data_in *data_in, unsigned index)
if (data_in->globals_resolution) if (data_in->globals_resolution)
{ {
ld_plugin_symbol_resolution_t ret; ld_plugin_symbol_resolution_t ret;
gcc_assert (index < VEC_length (ld_plugin_symbol_resolution_t, /* We can have references to not emitted functions in
data_in->globals_resolution)); DECL_FUNCTION_PERSONALITY at least. So we can and have
to indeed return LDPR_UNKNOWN in some cases. */
if (VEC_length (ld_plugin_symbol_resolution_t,
data_in->globals_resolution) <= index)
return LDPR_UNKNOWN;
ret = VEC_index (ld_plugin_symbol_resolution_t, ret = VEC_index (ld_plugin_symbol_resolution_t,
data_in->globals_resolution, data_in->globals_resolution,
index); index);
gcc_assert (ret != LDPR_UNKNOWN);
return ret; return ret;
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment