avoid overoptimizing implicitly generated functions of local classes in order to fix linking errors.
git-svn-id: file:///srv/svn/repos/haiku/trunk/buildtools@9620 a95241bf-73f2-0310-859d-f6bbb57e9c96
Diff
gcc/gcc/toplev.c | 2 ++
gcc/gcc/cp/lex.c | 8 ++++++++
2 files changed, 10 insertions(+)
@@ -2800,6 +2800,8 @@
&& DECL_INITIAL (decl) != 0
&& DECL_SAVED_INSNS (decl) != 0
&& (flag_keep_inline_functions
|| TREE_ADDRESSABLE (decl)
|| (TREE_PUBLIC (decl) && !DECL_COMDAT (decl))
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
{
@@ -2034,6 +2034,14 @@
SET_DECL_ARTIFICIAL (fn);
/* [zooey] force functions of local classes into such a mode, that they
will be output even after being inlined. This circumvents a bug that
causes undefined symbols when linking against files using local classes. */
if (DECL_CONTEXT (fn) != NULL_TREE && hack_decl_function_context (fn))
TREE_ADDRESSABLE(fn) = 1;
return fn;
}