Fix wrong code caulsed by retslot EAF flags propagation [PR103040]
Fixe (quite nasty) thinko in how I propagate EAF flags from callee
to caller. In this case some flags needs to be changed. In particular
- EAF_NOT_RETURNED in callee does not really mean EAF_NOT_RETURNED in caller
since we speak of different return values
- if callee escapes the parametr, we caller may return it
- for retslot the rewritting is even bit more funny, since escaping to of
return slot to return slot is not really an escape, however escape of
argument to itself is.
This patch should correct all of the cases above and does fix the testcase from PR103040.
Bootstrapped/regtested x86_64 with all languages. Also lto-bootstrapped.
gcc/ChangeLog:
PR ipa/103040
* ipa-modref.c (callee_to_caller_flags): New function.
(modref_eaf_analysis::analyze_ssa_name): Use it.
(ipa_merge_modref_summary_after_inlining): Fix whitespace.
gcc/testsuite/ChangeLog:
* g++.dg/torture/pr103040.C: New test.