re PR debug/51564 (ICE in force_type_die, at dwarf2out.c:19288)
authorRichard Guenther <rguenther@suse.de>
Thu, 15 Dec 2011 12:43:48 +0000 (12:43 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 15 Dec 2011 12:43:48 +0000 (12:43 +0000)
2011-12-15  Richard Guenther  <rguenther@suse.de>

PR lto/51564
* tree.h (REGISTER_DEFS_IN_THIS_STMT, NECESSARY,
STMT_IN_SSA_EDGE_WORKLIST): Remove no longer existing flag
uses documentation.
(TREE_ASM_WRITTEN): Update documentation to mention its use
on TYPE_DECLs from debug info generation.
* tree-streamer-out.c (pack_ts_base_value_fields): Stream
TREE_ASM_WRITTEN as always zero for TYPE_DECLs, similar to
all other types.

* g++.dg/lto/pr51564-1_0.C: New testcase.

From-SVN: r182367

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lto/pr51564-1_0.C [new file with mode: 0644]
gcc/tree-streamer-out.c
gcc/tree.h

index a12190f0ad264c375653f0da5818fc99a8823d38..cdfac22d83ffe4b7f69a6bc85b0fe34f0842bb93 100644 (file)
@@ -1,3 +1,15 @@
+2011-12-15  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/51564
+       * tree.h (REGISTER_DEFS_IN_THIS_STMT, NECESSARY,
+       STMT_IN_SSA_EDGE_WORKLIST): Remove no longer existing flag
+       uses documentation.
+       (TREE_ASM_WRITTEN): Update documentation to mention its use
+       on TYPE_DECLs from debug info generation.
+       * tree-streamer-out.c (pack_ts_base_value_fields): Stream
+       TREE_ASM_WRITTEN as always zero for TYPE_DECLs, similar to
+       all other types.
+
 2011-12-15  Georg-Johann Lay  <avr@gjlay.de>
 
        PR target/51050
index 71c3f67a2458a5ded6347bcfa6d662c573049565..212e455c6e662174c248c323c81e9a9071226c3a 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-15  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/51564
+       * g++.dg/lto/pr51564-1_0.C: New testcase.
+
 2011-12-15  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        PR libstdc++/51365
diff --git a/gcc/testsuite/g++.dg/lto/pr51564-1_0.C b/gcc/testsuite/g++.dg/lto/pr51564-1_0.C
new file mode 100644 (file)
index 0000000..5765cb1
--- /dev/null
@@ -0,0 +1,10 @@
+// { dg-lto-do link }
+// { dg-lto-options { { -flto -g } } }
+
+typedef int T;
+void foo(void) {}
+int main()
+{
+  foo();
+  using ::T;
+}
index d90ee803a1389269f9c0d37793b655e69cffe146..897c2115807d3ce9062f12b371e7ad9f7b0a1abf 100644 (file)
@@ -88,7 +88,8 @@ pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
   else
     bp_pack_value (bp, 0, 1);
   /* We write debug info two times, do not confuse the second one.  */
-  bp_pack_value (bp, TYPE_P (expr) ? 0 : TREE_ASM_WRITTEN (expr), 1);
+  bp_pack_value (bp, ((TYPE_P (expr) || TREE_CODE (expr) == TYPE_DECL)
+                     ? 0 : TREE_ASM_WRITTEN (expr)), 1);
   if (TYPE_P (expr))
     bp_pack_value (bp, TYPE_ARTIFICIAL (expr), 1);
   else
index eca2f8bb1fb2807a1081ec479507a31dd9aa41d1..2da054844c20e2125c6084c7b602a9fc4a902d66 100644 (file)
@@ -644,19 +644,13 @@ struct GTY(()) tree_common {
        DECL_UNSIGNED in
            all decls
 
-       REGISTER_DEFS_IN_THIS_STMT in
-           all expressions (tree-into-ssa.c)
-
    asm_written_flag:
 
        TREE_ASM_WRITTEN in
-           VAR_DECL, FUNCTION_DECL
+           VAR_DECL, FUNCTION_DECL, TYPE_DECL
            RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
            BLOCK, SSA_NAME, STRING_CST
 
-       NECESSARY in
-           all expressions (tree-ssa-dce.c, tree-ssa-pre.c)
-
    used_flag:
 
        TREE_USED in
@@ -685,9 +679,6 @@ struct GTY(()) tree_common {
        IDENTIFIER_TRANSPARENT_ALIAS in
            IDENTIFIER_NODE
 
-       STMT_IN_SSA_EDGE_WORKLIST in
-           all expressions (tree-ssa-propagate.c)
-
    visited:
 
        TREE_VISITED in
@@ -1369,8 +1360,8 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
    Nonzero in a FUNCTION_DECL means that the function has been compiled.
    This is interesting in an inline function, since it might not need
    to be compiled separately.
-   Nonzero in a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE or ENUMERAL_TYPE
-   if the debugging info for the type has been written.
+   Nonzero in a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, ENUMERAL_TYPE
+   or TYPE_DECL if the debugging info for the type has been written.
    In a BLOCK node, nonzero if reorder_blocks has already seen this block.
    In an SSA_NAME node, nonzero if the SSA_NAME occurs in an abnormal
    PHI node.  */