]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR lto/62034 (ICE for big statically initialized arrays compiled with LTO)
authorRichard Biener <rguenther@suse.de>
Wed, 6 Aug 2014 13:53:09 +0000 (13:53 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 6 Aug 2014 13:53:09 +0000 (13:53 +0000)
2014-08-06  Richard Biener  <rguenther@suse.de>

PR lto/62034
* lto-streamer-in.c (lto_input_tree_1): Assert we do not read
SCCs here.
(lto_input_tree): Pop SCCs here.

From-SVN: r213664

gcc/ChangeLog
gcc/lto-streamer-in.c

index 17882cd96ebc608f24fb17171f87e57cd372d0c8..3891aecd0de1844304c6a59ac6148e4fdd2b3b14 100644 (file)
@@ -1,3 +1,10 @@
+2014-08-06  Richard Biener  <rguenther@suse.de>
+
+       PR lto/62034
+       * lto-streamer-in.c (lto_input_tree_1): Assert we do not read
+       SCCs here.
+       (lto_input_tree): Pop SCCs here.
+
 2014-08-06  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/61320
index 698f92620dbf1d3493d60587f533c50f715b2a8d..9b95970824e27fd84f74907fd4afdb33d92d3085 100644 (file)
@@ -1324,15 +1324,7 @@ lto_input_tree_1 (struct lto_input_block *ib, struct data_in *data_in,
       streamer_tree_cache_append (data_in->reader_cache, result, hash);
     }
   else if (tag == LTO_tree_scc)
-    {
-      unsigned len, entry_len;
-
-      /* Input and skip the SCC.  */
-      lto_input_scc (ib, data_in, &len, &entry_len);
-
-      /* Recurse.  */
-      return lto_input_tree (ib, data_in);
-    }
+    gcc_unreachable ();
   else
     {
       /* Otherwise, materialize a new node from IB.  */
@@ -1345,7 +1337,15 @@ lto_input_tree_1 (struct lto_input_block *ib, struct data_in *data_in,
 tree
 lto_input_tree (struct lto_input_block *ib, struct data_in *data_in)
 {
-  return lto_input_tree_1 (ib, data_in, streamer_read_record_start (ib), 0);
+  enum LTO_tags tag;
+
+  /* Input and skip SCCs.  */
+  while ((tag = streamer_read_record_start (ib)) == LTO_tree_scc)
+    {
+      unsigned len, entry_len;
+      lto_input_scc (ib, data_in, &len, &entry_len);
+    }
+  return lto_input_tree_1 (ib, data_in, tag, 0);
 }