Improve handling of return slot in ipa-pure-const and modref.
while preparing testcase for return slot tracking I noticed that both
ipa-pure-const and modref treat return slot writes as non-local which prevents
detecting functions as pure or not modifying global state. Fixed by making
points_to_local_or_readonly_memory_p to special case return slot. This is bit
of a side case, but presently at all uses of
points_to_local_or_readonly_memory_p we want to handle return slot this way.
I also noticed that we handle gimple copy unnecesarily pesimistically. This
does not make difference right now since we do no not track non-scalars, but
I fixed it anyway.
Bootstrapped/regtested x86_64-linux, comitted.
gcc/ChangeLog:
* ipa-fnsummary.c: Include tree-dfa.h.
(points_to_local_or_readonly_memory_p): Return true on return
slot writes.
* ipa-modref.c (analyze_ssa_name_flags): Fix handling of copy
statement.
gcc/testsuite/ChangeLog:
* g++.dg/ipa/modref-1.C: New test.