From 787da5fdbfc9e126d42436959df0f1507f1a9c13 Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Mon, 19 Oct 2015 10:24:37 +0000 Subject: Fix PR68002, add -fkeep-static-functions gcc/ChangeLog: 2015-10-17 Joost VandeVondele PR middle-end/68002 * common.opt (fkeep-static-functions): New option. * doc/invoke.texi: Document it. * cgraphunit.c (cgraph_node::finalize_function): Use it. gcc/testsuite/ChangeLog: 2015-10-17 Joost VandeVondele PR middle-end/68002 * gcc.dg/PR68002.c: New test. From-SVN: r228965 --- gcc/cgraphunit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/cgraphunit.c') diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 04a4d3f..0b0c0f4 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -451,7 +451,7 @@ cgraph_node::finalize_function (tree decl, bool no_collect) declared inline and nested functions. These were optimized out in the original implementation and it is unclear whether we want to change the behavior here. */ - if ((!opt_for_fn (decl, optimize) + if (((!opt_for_fn (decl, optimize) || flag_keep_static_functions) && !node->cpp_implicit_alias && !DECL_DISREGARD_INLINE_LIMITS (decl) && !DECL_DECLARED_INLINE_P (decl) -- cgit v1.1