diff options
author | Richard Biener <rguenther@suse.de> | 2014-03-04 11:25:50 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-03-04 11:25:50 +0000 |
commit | 91856735012800f9cf75affc9abe6c7bf56739c8 (patch) | |
tree | a80cc2694efb22749344a087ddb94257dbd5480a /gcc/lto-section-in.c | |
parent | 064fd5a8d077d62dc4c0cf962f2b70b44cdb9a7f (diff) | |
download | gcc-91856735012800f9cf75affc9abe6c7bf56739c8.zip gcc-91856735012800f9cf75affc9abe6c7bf56739c8.tar.gz gcc-91856735012800f9cf75affc9abe6c7bf56739c8.tar.bz2 |
re PR lto/60405 (ICE in lto1 on x86_64-linux-gnu)
2014-03-04 Richard Biener <rguenther@suse.de>
PR lto/60405
* lto-streamer-in.c (lto_read_body): Remove LTO bytecode version
check.
(lto_input_toplevel_asms): Likewise.
* lto-section-in.c (lto_get_section_data): Instead do it here
for every section.
From-SVN: r208311
Diffstat (limited to 'gcc/lto-section-in.c')
-rw-r--r-- | gcc/lto-section-in.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/gcc/lto-section-in.c b/gcc/lto-section-in.c index 47f9739..60346dc 100644 --- a/gcc/lto-section-in.c +++ b/gcc/lto-section-in.c @@ -153,26 +153,30 @@ lto_get_section_data (struct lto_file_decl_data *file_data, /* FIXME lto: WPA mode does not write compressed sections, so for now suppress uncompression if flag_ltrans. */ - if (flag_ltrans) - return data; - - /* Create a mapping header containing the underlying data and length, - and prepend this to the uncompression buffer. The uncompressed data - then follows, and a pointer to the start of the uncompressed data is - returned. */ - header = (struct lto_data_header *) xmalloc (header_length); - header->data = data; - header->len = *len; - - buffer.data = (char *) header; - buffer.length = header_length; - - stream = lto_start_uncompression (lto_append_data, &buffer); - lto_uncompress_block (stream, data, *len); - lto_end_uncompression (stream); + if (!flag_ltrans) + { + /* Create a mapping header containing the underlying data and length, + and prepend this to the uncompression buffer. The uncompressed data + then follows, and a pointer to the start of the uncompressed data is + returned. */ + header = (struct lto_data_header *) xmalloc (header_length); + header->data = data; + header->len = *len; + + buffer.data = (char *) header; + buffer.length = header_length; + + stream = lto_start_uncompression (lto_append_data, &buffer); + lto_uncompress_block (stream, data, *len); + lto_end_uncompression (stream); + + *len = buffer.length - header_length; + data = buffer.data + header_length; + } - *len = buffer.length - header_length; - return buffer.data + header_length; + lto_check_version (((lto_header *)data)->major_version, + ((lto_header *)data)->minor_version); + return data; } |