re PR lto/46911 (ICE: SIGSEGV in add_name_and_src_coords_attributes (dwarf2out.c...
authorRichard Guenther <rguenther@suse.de>
Tue, 1 Mar 2011 09:45:05 +0000 (09:45 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 1 Mar 2011 09:45:05 +0000 (09:45 +0000)
2011-03-01  Richard Guenther  <rguenther@suse.de>

PR lto/46911
* lto-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
Do not stream DECL_ABSTRACT_ORIGIN.
(lto_input_ts_block_tree_pointers): Nor BLOCK_SOURCE_LOCATION,
BLOCK_NONLOCALIZED_VARS or BLOCK_ABSTRACT_ORIGIN.
* lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers):
Do not stream DECL_ABSTRACT_ORIGIN.
(lto_output_ts_block_tree_pointers): Nor BLOCK_SOURCE_LOCATION,
BLOCK_NONLOCALIZED_VARS or BLOCK_ABSTRACT_ORIGIN.

* gfortran.dg/lto/pr46911_0.f: New testcase.

From-SVN: r170588

gcc/ChangeLog
gcc/lto-streamer-in.c
gcc/lto-streamer-out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/lto/pr46911_0.f [new file with mode: 0644]

index 89661c288c675ec18c94df03c19b4c02a857fc29..5d567fb498ac5e45997f3f06818885065f7d82d8 100644 (file)
@@ -1,3 +1,15 @@
+2011-03-01  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/46911
+       * lto-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
+       Do not stream DECL_ABSTRACT_ORIGIN.
+       (lto_input_ts_block_tree_pointers): Nor BLOCK_SOURCE_LOCATION,
+       BLOCK_NONLOCALIZED_VARS or BLOCK_ABSTRACT_ORIGIN.
+       * lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers):
+       Do not stream DECL_ABSTRACT_ORIGIN.
+       (lto_output_ts_block_tree_pointers): Nor BLOCK_SOURCE_LOCATION,
+       BLOCK_NONLOCALIZED_VARS or BLOCK_ABSTRACT_ORIGIN.
+
 2011-02-28  Anatoly Sokolov  <aesok@post.ru>
 
        * config/stormy16/stormy16.h (FUNCTION_VALUE, LIBCALL_VALUE,
 2011-02-28  Anatoly Sokolov  <aesok@post.ru>
 
        * config/stormy16/stormy16.h (FUNCTION_VALUE, LIBCALL_VALUE,
index 058885d2252cd0d5789a3b5e69b4fba8abe2934b..a87325835f2d20f2befa8a2eaf596ea6d7424a13 100644 (file)
@@ -1980,7 +1980,9 @@ lto_input_ts_decl_common_tree_pointers (struct lto_input_block *ib,
     DECL_INITIAL (expr) = lto_input_tree (ib, data_in);
 
   DECL_ATTRIBUTES (expr) = lto_input_tree (ib, data_in);
     DECL_INITIAL (expr) = lto_input_tree (ib, data_in);
 
   DECL_ATTRIBUTES (expr) = lto_input_tree (ib, data_in);
-  DECL_ABSTRACT_ORIGIN (expr) = lto_input_tree (ib, data_in);
+  /* Do not stream DECL_ABSTRACT_ORIGIN.  We cannot handle debug information
+     for early inlining so drop it on the floor instead of ICEing in
+     dwarf2out.c.  */
 
   if (TREE_CODE (expr) == PARM_DECL)
     TREE_CHAIN (expr) = lto_input_chain (ib, data_in);
 
   if (TREE_CODE (expr) == PARM_DECL)
     TREE_CHAIN (expr) = lto_input_chain (ib, data_in);
@@ -2179,24 +2181,19 @@ static void
 lto_input_ts_block_tree_pointers (struct lto_input_block *ib,
                                  struct data_in *data_in, tree expr)
 {
 lto_input_ts_block_tree_pointers (struct lto_input_block *ib,
                                  struct data_in *data_in, tree expr)
 {
-  unsigned i, len;
-
-  BLOCK_SOURCE_LOCATION (expr) = lto_input_location (ib, data_in);
+  /* Do not stream BLOCK_SOURCE_LOCATION.  We cannot handle debug information
+     for early inlining so drop it on the floor instead of ICEing in
+     dwarf2out.c.  */
   BLOCK_VARS (expr) = lto_input_chain (ib, data_in);
 
   BLOCK_VARS (expr) = lto_input_chain (ib, data_in);
 
-  len = lto_input_uleb128 (ib);
-  if (len > 0)
-    {
-      VEC_reserve_exact (tree, gc, BLOCK_NONLOCALIZED_VARS (expr), len);
-      for (i = 0; i < len; i++)
-       {
-         tree t = lto_input_tree (ib, data_in);
-         VEC_quick_push (tree, BLOCK_NONLOCALIZED_VARS (expr), t);
-       }
-    }
+  /* Do not stream BLOCK_NONLOCALIZED_VARS.  We cannot handle debug information
+     for early inlining so drop it on the floor instead of ICEing in
+     dwarf2out.c.  */
 
   BLOCK_SUPERCONTEXT (expr) = lto_input_tree (ib, data_in);
 
   BLOCK_SUPERCONTEXT (expr) = lto_input_tree (ib, data_in);
-  BLOCK_ABSTRACT_ORIGIN (expr) = lto_input_tree (ib, data_in);
+  /* Do not stream BLOCK_ABSTRACT_ORIGIN.  We cannot handle debug information
+     for early inlining so drop it on the floor instead of ICEing in
+     dwarf2out.c.  */
   BLOCK_FRAGMENT_ORIGIN (expr) = lto_input_tree (ib, data_in);
   BLOCK_FRAGMENT_CHAIN (expr) = lto_input_tree (ib, data_in);
   /* We re-compute BLOCK_SUBBLOCKS of our parent here instead
   BLOCK_FRAGMENT_ORIGIN (expr) = lto_input_tree (ib, data_in);
   BLOCK_FRAGMENT_CHAIN (expr) = lto_input_tree (ib, data_in);
   /* We re-compute BLOCK_SUBBLOCKS of our parent here instead
index 29d171bd7f41cc9d58a93b19b28c7d188f778d6b..ba916b64c34f2ee31744f515a6e6d69b3e1a4f69 100644 (file)
@@ -870,7 +870,9 @@ lto_output_ts_decl_common_tree_pointers (struct output_block *ob, tree expr,
     }
 
   lto_output_tree_or_ref (ob, DECL_ATTRIBUTES (expr), ref_p);
     }
 
   lto_output_tree_or_ref (ob, DECL_ATTRIBUTES (expr), ref_p);
-  lto_output_tree_or_ref (ob, DECL_ABSTRACT_ORIGIN (expr), ref_p);
+  /* Do not stream DECL_ABSTRACT_ORIGIN.  We cannot handle debug information
+     for early inlining so drop it on the floor instead of ICEing in
+     dwarf2out.c.  */
 
   if (TREE_CODE (expr) == PARM_DECL)
     lto_output_chain (ob, TREE_CHAIN (expr), ref_p);
 
   if (TREE_CODE (expr) == PARM_DECL)
     lto_output_chain (ob, TREE_CHAIN (expr), ref_p);
@@ -1054,21 +1056,19 @@ static void
 lto_output_ts_block_tree_pointers (struct output_block *ob, tree expr,
                                   bool ref_p)
 {
 lto_output_ts_block_tree_pointers (struct output_block *ob, tree expr,
                                   bool ref_p)
 {
-  unsigned i;
-  tree t;
-
-  lto_output_location (ob, BLOCK_SOURCE_LOCATION (expr));
+  /* Do not stream BLOCK_SOURCE_LOCATION.  We cannot handle debug information
+     for early inlining so drop it on the floor instead of ICEing in
+     dwarf2out.c.  */
   lto_output_chain (ob, BLOCK_VARS (expr), ref_p);
 
   lto_output_chain (ob, BLOCK_VARS (expr), ref_p);
 
-  output_uleb128 (ob, VEC_length (tree, BLOCK_NONLOCALIZED_VARS (expr)));
-  FOR_EACH_VEC_ELT (tree, BLOCK_NONLOCALIZED_VARS (expr), i, t)
-    {
-      gcc_assert (DECL_CONTEXT (t) != expr);
-      lto_output_tree_or_ref (ob, t, ref_p);
-    }
+  /* Do not stream BLOCK_NONLOCALIZED_VARS.  We cannot handle debug information
+     for early inlining so drop it on the floor instead of ICEing in
+     dwarf2out.c.  */
 
   lto_output_tree_or_ref (ob, BLOCK_SUPERCONTEXT (expr), ref_p);
 
   lto_output_tree_or_ref (ob, BLOCK_SUPERCONTEXT (expr), ref_p);
-  lto_output_tree_or_ref (ob, BLOCK_ABSTRACT_ORIGIN (expr), ref_p);
+  /* Do not stream BLOCK_ABSTRACT_ORIGIN.  We cannot handle debug information
+     for early inlining so drop it on the floor instead of ICEing in
+     dwarf2out.c.  */
   lto_output_tree_or_ref (ob, BLOCK_FRAGMENT_ORIGIN (expr), ref_p);
   lto_output_tree_or_ref (ob, BLOCK_FRAGMENT_CHAIN (expr), ref_p);
   /* Do not output BLOCK_SUBBLOCKS.  Instead on streaming-in this
   lto_output_tree_or_ref (ob, BLOCK_FRAGMENT_ORIGIN (expr), ref_p);
   lto_output_tree_or_ref (ob, BLOCK_FRAGMENT_CHAIN (expr), ref_p);
   /* Do not output BLOCK_SUBBLOCKS.  Instead on streaming-in this
index e8d4685d95da04a21c16d022e0914d61a44e0386..65e0db406bf2f8f30e7e31294af7d17136093497 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-01  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/46911
+       * gfortran.dg/lto/pr46911_0.f: New testcase.
+
 2011-02-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/47933
 2011-02-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/47933
diff --git a/gcc/testsuite/gfortran.dg/lto/pr46911_0.f b/gcc/testsuite/gfortran.dg/lto/pr46911_0.f
new file mode 100644 (file)
index 0000000..fce9597
--- /dev/null
@@ -0,0 +1,6 @@
+! { dg-lto-do link }
+! { dg-lto-options {{ -O2 -flto -g }} }
+! { dg-extra-ld-options "-r -nostdlib" }
+      common/main1/ eps(2)
+      call dalie6s(iqmod6,1,wx,cor6d)
+      end