ipa-modref bits for unsequenced and reproducible
C attributes reproducible and unsequenced implies that calling function twice leads to same effect if parameters are otherwise unchanged (function call itself does not count). This is bit bit stronger that modref's notion of nondeterminism that says that same inputs will yield same outputs (function call itself does count). This patch makes reproducible/unsequenced imply determinism and cleans up determinism handling. By itself it is not useful, since we can not make use of it unless we know what are the inputs/outputs of the function which I plan to handle by the "fn spec" attribute. gcc/ChangeLog: * ipa-modref.cc (modref_summary::useful_p): const/pure implies determinism. (modref_summary_lto::useful_p): Likewise. (ignore_nondeterminism_p): Add CALLEE_FNTYPE parameter; check for reproducible/unsequenced (modref_access_analysis::record_access_p): Use ignore_nondeterminism_p when handling volatile accesses. (modref_access_analysis::get_access_for_fnspec): Update. (modref_access_analysis::process_fnspec): Cleanup handling of NOVOPS. (modref_access_analysis::analyze_call): Use ignore_nondeterminism_p when handling asm statements. (modref_access_analysis::analyze_stmt): Update. (propagate_unknown_call): Update. (modref_propagate_in_scc): Update. (ipa_merge_modref_summary_after_inlining): Update.
Loading
Please register or sign in to comment