Add fnspec handling to ipa mode of ipa-modef.
authorJan Hubicka <jh@suse.cz>
Fri, 6 Nov 2020 09:23:58 +0000 (10:23 +0100)
committerJan Hubicka <jh@suse.cz>
Fri, 6 Nov 2020 09:23:58 +0000 (10:23 +0100)
commit6cef01c32817b3d08af2cadcdb0e23c72ceed426
tree8d0c62cd340e8857600008968c18df33092174e0
parent366099ff0823c3c9929dd7fb911f4af04e63baef
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
gcc/ipa-fnsummary.c
gcc/ipa-modref.c
gcc/ipa-prop.c
gcc/testsuite/gcc.dg/ipa/modref-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/modref-2_0.c [new file with mode: 0644]