From: rguenth Date: Wed, 19 May 2010 15:57:17 +0000 (+0000) Subject: 2010-05-19 Richard Guenther X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e35f74d5cd4b44925efd02c63399b5e83f086fb2;p=thirdparty%2Fgcc.git 2010-05-19 Richard Guenther PR lto/44196 * tree.c (find_decls_types_r): Walk BLOCKs and its vars. * g++.dg/lto/20100519-1_0.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159582 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ec47a66cb359..5eb9e02379bb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-05-19 Richard Guenther + + PR lto/44196 + * tree.c (find_decls_types_r): Walk BLOCKs and its vars. + 2010-05-19 Richard Guenther * doc/invoke.texi (-fwhopr): Document new optional jobs argument. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 12f4e3cb6bf5..4de8c08286e0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-05-19 Richard Guenther + + PR lto/44196 + * g++.dg/lto/20100519-1_0.C: New testcase. + 2010-05-19 Daniel Franke PR fortran/42360 diff --git a/gcc/testsuite/g++.dg/lto/20100519-1_0.C b/gcc/testsuite/g++.dg/lto/20100519-1_0.C new file mode 100644 index 000000000000..bc2ddf140d15 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/20100519-1_0.C @@ -0,0 +1,23 @@ +// { dg-lto-do link } + +template +struct DirectSerializationTraits +{ + static void fromCountToDirectBytes(const Ordinal count) {} +}; +template class SerializationTraits + : public DirectSerializationTraits { }; +template +class ConstValueTypeSerializationBuffer +{ +public: + ConstValueTypeSerializationBuffer(const Ordinal count) + { + typedef SerializationTraits SerT; + SerT::fromCountToDirectBytes(count); + } +}; +int main () +{ + ConstValueTypeSerializationBuffer charSendBuffer(1); +} diff --git a/gcc/tree.c b/gcc/tree.c index 76be316eef9f..fbf24b1e8bc8 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -4713,6 +4713,15 @@ find_decls_types_r (tree *tp, int *ws, void *data) fld_worklist_push (TREE_CHAIN (t), fld); *ws = 0; } + else if (TREE_CODE (t) == BLOCK) + { + tree tem; + for (tem = BLOCK_VARS (t); tem; tem = TREE_CHAIN (tem)) + fld_worklist_push (tem, fld); + for (tem = BLOCK_SUBBLOCKS (t); tem; tem = BLOCK_CHAIN (tem)) + fld_worklist_push (tem, fld); + fld_worklist_push (BLOCK_ABSTRACT_ORIGIN (t), fld); + } fld_worklist_push (TREE_TYPE (t), fld);