Skip to content
Snippets Groups Projects
Commit addf0228 authored by Jan Hubicka's avatar Jan Hubicka
Browse files

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.
parent aac5c57e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment