https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103040
--- Comment #18 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jan Hubicka <hubi...@gcc.gnu.org>: https://gcc.gnu.org/g:62af7d9402f551fa708125fafed2950d8912b25e commit r12-4857-g62af7d9402f551fa708125fafed2950d8912b25e Author: Jan Hubicka <hubi...@ucw.cz> Date: Wed Nov 3 01:45:47 2021 +0100 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.