From baa4a2c65a59d4723a03b229e5438eca0009932c Mon Sep 17 00:00:00 2001 From: rguenth Date: Tue, 4 Mar 2014 11:25:50 +0000 Subject: [PATCH] 2014-03-04 Richard Biener 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208311 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 9 +++++++++ gcc/lto-section-in.c | 42 +++++++++++++++++++++++------------------- gcc/lto-streamer-in.c | 8 -------- 3 files changed, 32 insertions(+), 27 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ee70301..2faa849 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2014-03-04 Richard Biener + 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. + +2014-03-04 Richard Biener + PR tree-optimization/60382 * tree-vect-loop.c (vect_is_simple_reduction_1): Do not consider dead PHIs a reduction. 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; } diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index 68d3cda..da248b9 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -1059,10 +1059,6 @@ lto_read_body (struct lto_file_decl_data *file_data, struct cgraph_node *node, data_in = lto_data_in_create (file_data, data + string_offset, header->string_size, vNULL); - /* Make sure the file was generated by the exact same compiler. */ - lto_check_version (header->lto_header.major_version, - header->lto_header.minor_version); - if (section_type == LTO_section_function_body) { struct lto_in_decl_state *decl_state; @@ -1331,10 +1327,6 @@ lto_input_toplevel_asms (struct lto_file_decl_data *file_data, int order_base) data_in = lto_data_in_create (file_data, data + string_offset, header->string_size, vNULL); - /* Make sure the file was generated by the exact same compiler. */ - lto_check_version (header->lto_header.major_version, - header->lto_header.minor_version); - while ((str = streamer_read_string_cst (data_in, &ib))) { struct asm_node *node = add_asm_node (str); -- 2.7.4