aboutsummaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2018-11-20 14:25:04 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2018-11-20 13:25:04 +0000
commit12485662c00914ed132d950f1329fdaf32c11a3c (patch)
tree915c311dd930a542e608132872f89e56f2d114e0 /gcc/passes.c
parent8c944c97a2e5a264779ad1d448f97319f471275a (diff)
downloadgcc-12485662c00914ed132d950f1329fdaf32c11a3c.zip
gcc-12485662c00914ed132d950f1329fdaf32c11a3c.tar.gz
gcc-12485662c00914ed132d950f1329fdaf32c11a3c.tar.bz2
re PR ipa/87706 (Inlined functions trigger invalid -Wmissing-profile warning)
PR ipa/87706 * ipa-fnsummary.c (pass_ipa_fnsummary): Do not remove functions * ipa.c (possible_inline_candidate_p): Break out from .. (process_references): ... here ; drop before_inlining_p; cleanup handling of alises. (walk_polymorphic_call_targets): Likewise. (symbol_table::remove_unreachable_nodes): Likewise. * passes.c (pass_data_ipa_remove_symbols): New structure. (pass_ipa_remove_symbols): New pass. (make_pass_ipa_remove_symbols): New functoin. * passes.def (pass_ipa_remove_symbols): Schedule after early passes. From-SVN: r266315
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index 5d2372b..85aa47d 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -459,6 +459,35 @@ public:
}; // class pass_local_optimization_passes
+const pass_data pass_data_ipa_remove_symbols =
+{
+ SIMPLE_IPA_PASS, /* type */
+ "remove_symbols", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_remove_functions | TODO_dump_symtab, /* todo_flags_finish */
+};
+
+class pass_ipa_remove_symbols : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_remove_symbols (gcc::context *ctxt)
+ : simple_ipa_opt_pass (pass_data_ipa_remove_symbols, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ virtual bool gate (function *)
+ {
+ /* Don't bother doing anything if the program has errors. */
+ return (!seen_error () && !in_lto_p);
+ }
+
+}; // class pass_local_optimization_passes
+
} // anon namespace
simple_ipa_opt_pass *
@@ -473,6 +502,12 @@ make_pass_local_optimization_passes (gcc::context *ctxt)
return new pass_local_optimization_passes (ctxt);
}
+simple_ipa_opt_pass *
+make_pass_ipa_remove_symbols (gcc::context *ctxt)
+{
+ return new pass_ipa_remove_symbols (ctxt);
+}
+
namespace {
const pass_data pass_data_all_early_optimizations =