From 6cef01c32817b3d08af2cadcdb0e23c72ceed426 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Fri, 6 Nov 2020 10:23:58 +0100 Subject: Add fnspec handling to ipa mode of ipa-modef. gcc/: * attr-fnspec.h (attr_fnspec::get_str): New accessor * ipa-fnsummary.c (read_ipa_call_summary): Store also parm info for builtins. * ipa-modref.c (class fnspec_summary): New type. (class fnspec_summaries_t): New type. (modref_summary::modref_summary): Initialize writes_errno. (struct modref_summary_lto): Add writes_errno. (modref_summary_lto::modref_summary_lto): Initialize writes_errno. (modref_summary::dump): Check for NULL pointers. (modref_summary_lto::dump): Dump writes_errno. (collapse_loads): Move up in source file. (collapse_stores): New function. (process_fnspec): Handle also internal calls. (analyze_call): Likewise. (analyze_stmt): Store fnspec string if needed. (analyze_function): Initialize fnspec_sumarries. (modref_summaries_lto::duplicate): Copy writes_errno. (modref_write): Store writes_errno and fnspec summaries. (read_section): Read writes_errno and fnspec summaries. (modref_read): Initialize fnspec summaries. (update_signature): Fix formating. (compute_parm_map): Return true if sucessful. (get_parm_type): New function. (get_access_for_fnspec): New function. (propagate_unknown_call): New function. (modref_propagate_in_scc): Use it. (pass_ipa_modref::execute): Delete fnspec_summaries. (ipa_modref_c_finalize): Delete fnspec_summaries. * ipa-prop.c: Include attr-fnspec.h. (ipa_compute_jump_functions_for_bb): Also compute jump functions for functions with fnspecs. (ipa_read_edge_info): Read jump functions for builtins. gcc/testsuite/ChangeLog: * gcc.dg/ipa/modref-2.c: New test. * gcc.dg/lto/modref-2_0.c: New test. --- gcc/attr-fnspec.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/attr-fnspec.h') diff --git a/gcc/attr-fnspec.h b/gcc/attr-fnspec.h index 78b1a5a..28135328 100644 --- a/gcc/attr-fnspec.h +++ b/gcc/attr-fnspec.h @@ -246,6 +246,13 @@ public: /* Check validity of the string. */ void verify (); + + /* Return the fnspec string. */ + const char * + get_str () + { + return str; + } }; extern attr_fnspec gimple_call_fnspec (const gcall *stmt); -- cgit v1.1