2014-03-04 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Mar 2014 11:25:50 +0000 (11:25 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Mar 2014 11:25:50 +0000 (11:25 +0000)
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
gcc/lto-section-in.c
gcc/lto-streamer-in.c

index ee70301..2faa849 100644 (file)
@@ -1,5 +1,14 @@
 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.
+2014-03-04  Richard Biener  <rguenther@suse.de>
+
        PR tree-optimization/60382
        * tree-vect-loop.c (vect_is_simple_reduction_1): Do not consider
        dead PHIs a reduction.
index 47f9739..60346dc 100644 (file)
@@ -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;
 }
 
 
index 68d3cda..da248b9 100644 (file)
@@ -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);