diff options
author | Richard Guenther <rguenther@suse.de> | 2011-12-13 14:43:44 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-12-13 14:43:44 +0000 |
commit | ea973bad53d63fa66e3a6b0446ae95e7e130f30a (patch) | |
tree | ef1bbe465db7790613b6d18f148baf8d06fab828 /gcc | |
parent | 88d599dcf67fd7be5c2a6bdd279bbd7e1ac7f7aa (diff) | |
download | gcc-ea973bad53d63fa66e3a6b0446ae95e7e130f30a.zip gcc-ea973bad53d63fa66e3a6b0446ae95e7e130f30a.tar.gz gcc-ea973bad53d63fa66e3a6b0446ae95e7e130f30a.tar.bz2 |
re PR debug/48354 (internal compiler error: in splice_child_die, at dwarf2out.c:8064)
2011-12-13 Richard Guenther <rguenther@suse.de>
PR lto/48354
* tree.c (find_decls_types_r): Also walk DECL_ORIGINAL_TYPE.
* tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers):
Stream DECL_ORIGINAL_TYPE.
* tree-streamer-out.c (write_ts_decl_non_common_tree_pointers):
Likewise.
lto/
* lto.c (lto_ft_decl_non_common): When we merged DECL_ORIGINAL_TYPE
with the type of the TYPE_DECL clear DECL_ORIGINAL_TYPE.
* g++.dg/lto/pr48354-1_0.C: New testcase.
From-SVN: r182286
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/lto/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto/lto.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/pr48354-1_0.C | 16 | ||||
-rw-r--r-- | gcc/tree-streamer-in.c | 2 | ||||
-rw-r--r-- | gcc/tree-streamer-out.c | 2 | ||||
-rw-r--r-- | gcc/tree.c | 1 |
8 files changed, 48 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f6ba6b4..a710764 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2011-12-13 Richard Guenther <rguenther@suse.de> + + PR lto/48354 + * tree.c (find_decls_types_r): Also walk DECL_ORIGINAL_TYPE. + * tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers): + Stream DECL_ORIGINAL_TYPE. + * tree-streamer-out.c (write_ts_decl_non_common_tree_pointers): + Likewise. + 2011-12-13 Jakub Jelinek <jakub@redhat.com> Revert diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 6f13e04..2c7d83b 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2011-12-13 Richard Guenther <rguenther@suse.de> + + PR lto/48354 + * lto.c (lto_ft_decl_non_common): When we merged DECL_ORIGINAL_TYPE + with the type of the TYPE_DECL clear DECL_ORIGINAL_TYPE. + 2011-12-01 Uros Bizjak <ubizjak@gmail.com> * lto-lang.c (lto_attribute_table): Handle *tm regparm. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 3b35604..accb807 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -381,6 +381,13 @@ lto_ft_decl_non_common (tree t) LTO_FIXUP_TREE (DECL_ARGUMENT_FLD (t)); LTO_FIXUP_TREE (DECL_RESULT_FLD (t)); LTO_FIXUP_TREE (DECL_VINDEX (t)); + /* The C frontends may create exact duplicates for DECL_ORIGINAL_TYPE + like for 'typedef enum foo foo'. We have no way of avoiding to + merge them and dwarf2out.c cannot deal with this, + so fix this up by clearing DECL_ORIGINAL_TYPE in this case. */ + if (TREE_CODE (t) == TYPE_DECL + && DECL_ORIGINAL_TYPE (t) == TREE_TYPE (t)) + DECL_ORIGINAL_TYPE (t) = NULL_TREE; } /* Fix up fields of a decl_non_common T. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5de35b0..849dda0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2011-12-13 Richard Guenther <rguenther@suse.de> + PR lto/48354 + * g++.dg/lto/pr48354-1_0.C: New testcase. + +2011-12-13 Richard Guenther <rguenther@suse.de> + PR tree-optimization/51519 * gcc.dg/pr51519.c: New testcase. diff --git a/gcc/testsuite/g++.dg/lto/pr48354-1_0.C b/gcc/testsuite/g++.dg/lto/pr48354-1_0.C new file mode 100644 index 0000000..b2ae977 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr48354-1_0.C @@ -0,0 +1,16 @@ +// { dg-lto-do link } +// { dg-lto-options { { -g -flto } } } +// { dg-extra-ld-options "-r -nostdlib" } + +template<typename T> struct Identity { typedef T type; }; +struct S { + typedef void (S::*FP)(); + FP fp; +}; +void g(); +void f() { + typedef Identity<S>::type Dummy; + S s; + g(); +} + diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c index 86eb9ce..919a5be 100644 --- a/gcc/tree-streamer-in.c +++ b/gcc/tree-streamer-in.c @@ -602,6 +602,8 @@ lto_input_ts_decl_non_common_tree_pointers (struct lto_input_block *ib, DECL_ARGUMENTS (expr) = stream_read_tree (ib, data_in); DECL_RESULT (expr) = stream_read_tree (ib, data_in); } + else if (TREE_CODE (expr) == TYPE_DECL) + DECL_ORIGINAL_TYPE (expr) = stream_read_tree (ib, data_in); DECL_VINDEX (expr) = stream_read_tree (ib, data_in); } diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index c46859f..fea15ff 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -508,6 +508,8 @@ write_ts_decl_non_common_tree_pointers (struct output_block *ob, tree expr, stream_write_tree (ob, DECL_ARGUMENTS (expr), ref_p); stream_write_tree (ob, DECL_RESULT (expr), ref_p); } + else if (TREE_CODE (expr) == TYPE_DECL) + stream_write_tree (ob, DECL_ORIGINAL_TYPE (expr), ref_p); stream_write_tree (ob, DECL_VINDEX (expr), ref_p); } @@ -4796,6 +4796,7 @@ find_decls_types_r (tree *tp, int *ws, void *data) { fld_worklist_push (DECL_ARGUMENT_FLD (t), fld); fld_worklist_push (DECL_VINDEX (t), fld); + fld_worklist_push (DECL_ORIGINAL_TYPE (t), fld); } else if (TREE_CODE (t) == FIELD_DECL) { |