From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1075) id B43293858C60; Sun, 19 Dec 2021 21:40:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B43293858C60 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jan Hubicka To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6067] Fix early exit in modref_merge_call_site_flags X-Act-Checkin: gcc X-Git-Author: Jan Hubicka X-Git-Refname: refs/heads/master X-Git-Oldrev: 6bcb6ed5a44b6f271891246ef7ae568bfdc14e9c X-Git-Newrev: fcbf94a5be9e0c1ecad92da773a6632b86b7f70a Message-Id: <20211219214047.B43293858C60@sourceware.org> Date: Sun, 19 Dec 2021 21:40:47 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2021 21:40:47 -0000 https://gcc.gnu.org/g:fcbf94a5be9e0c1ecad92da773a6632b86b7f70a commit r12-6067-gfcbf94a5be9e0c1ecad92da773a6632b86b7f70a Author: Jan Hubicka Date: Sun Dec 19 22:28:40 2021 +0100 Fix early exit in modref_merge_call_site_flags When adding support for static chain and return slot flags I forgot to update early exit condition in modref_merge_call_site_flags. This yields to wrong code as demonstrated by the Fortran testcase attached to PR (which I hope someone will help me to turn into testuite one). gcc/ChangeLog: 2021-12-19 Jan Hubicka PR ipa/103766 * ipa-modref.c (modref_merge_call_site_flags): Fix early exit condition Diff: --- gcc/ipa-modref.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c index d3590f0b62b..9c411a6297a 100644 --- a/gcc/ipa-modref.c +++ b/gcc/ipa-modref.c @@ -5019,9 +5019,15 @@ modref_merge_call_site_flags (escape_summary *sum, bool changed = false; bool ignore_stores = ignore_stores_p (caller, callee_ecf_flags); - /* If we have no useful info to propagate. */ - if ((!cur_summary || !cur_summary->arg_flags.length ()) - && (!cur_summary_lto || !cur_summary_lto->arg_flags.length ())) + /* Return early if we have no useful info to propagate. */ + if ((!cur_summary + || (!cur_summary->arg_flags.length () + && !cur_summary->static_chain_flags + && !cur_summary->retslot_flags)) + && (!cur_summary_lto + || (!cur_summary_lto->arg_flags.length () + && !cur_summary_lto->static_chain_flags + && !cur_summary_lto->retslot_flags))) return false; FOR_EACH_VEC_ELT (sum->esc, i, ee)