diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index d3590f0b62bbff43838b0d4e37338cf3c2411f7e..9c411a6297a95aee3d6d41e405d3805244940ca5 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)