]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ipa-cp.c
Merge lto branch into trunk.
[thirdparty/gcc.git] / gcc / ipa-cp.c
index f7782cbbf83194a3c6215f4ef586f8d9845dee85..a974dd0aab3f9f237d91ac9dfed91e042b34a11f 100644 (file)
@@ -1273,7 +1273,13 @@ ipcp_generate_summary (void)
 static bool
 cgraph_gate_cp (void)
 {
-  return flag_ipa_cp;
+  /* FIXME lto.  IPA-CP does not tolerate running when the inlining decisions
+     have not been applied.  This happens when WPA modifies the callgraph.
+     Since those decisions are not applied until after all the IPA passes
+     have been run in LTRANS, this means that IPA passes may see partially
+     modified callgraphs.  The solution to this is to apply WPA decisions
+     early during LTRANS.  */
+  return flag_ipa_cp && !flag_ltrans;
 }
 
 struct ipa_opt_pass_d pass_ipa_cp =