summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-02-05 15:31:15 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-02-05 15:31:15 +0000
commit7c974441b340451d0219fd3e0eeb7e8dc94d7ab2 (patch)
tree9886dafb7bd09ee3c71d1e400ba40a10a4dcf1cd /gcc
parent6872bf3c9ec31fbfa08c92fffb68780cfcd9eb15 (diff)
downloadgcc-7c974441b340451d0219fd3e0eeb7e8dc94d7ab2.tar.gz
2010-02-05 Richard Guenther <rguenther@suse.de>
PR lto/42762 * lto-streamer-in.c (get_resolution): Deal with references to undefined functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156520 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/lto-streamer-in.c9
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1fe28e52da5..b7548b91ba4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
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
conversions.
(fold_const_aggregate_ref): Likewise.
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index e41917702f1..095591484db 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -1515,12 +1515,15 @@ get_resolution (struct data_in *data_in, unsigned index)
if (data_in->globals_resolution)
{
ld_plugin_symbol_resolution_t ret;
- gcc_assert (index < VEC_length (ld_plugin_symbol_resolution_t,
- data_in->globals_resolution));
+ /* We can have references to not emitted functions in
+ 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,
data_in->globals_resolution,
index);
- gcc_assert (ret != LDPR_UNKNOWN);
return ret;
}
else