public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix -fdump-ipa-all ICE
@ 2017-04-24 11:03 Jan Hubicka
  2017-04-24 11:25 ` Jakub Jelinek
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Hubicka @ 2017-04-24 11:03 UTC (permalink / raw)
  To: gcc-patches, jakub, rguenther

Hi,
this patch fixes ICE in dumping that triggers somewhat overactive sanity check.
I think it would be nice to get it into release branches so we could debug things
more easily.

I am going to commit to trunk, OK for release branches?
Honza
	PR middle-end/79931
	* ipa-devirt.c (dump_possible_polymorphic_call_targets): Fix ICE.
Index: ipa-devirt.c
===================================================================
--- ipa-devirt.c	(revision 246970)
+++ ipa-devirt.c	(working copy)
@@ -3367,7 +3367,13 @@ dump_possible_polymorphic_call_targets (
       fprintf (f, "  Speculative targets:");
       dump_targets (f, targets);
     }
-  gcc_assert (targets.length () <= len);
+  /* Ugly: during callgraph construction the target cache may get populated
+     before all targets are found.  While this is harmless (because all local
+     types are discovered and only in those case we devirtualize fully and we
+     don't do speculative devirtualization before IPA stage) it triggers
+     assert here when dumping at that stage also populates the case with
+     speculative targets.  Quietly ignore this.  */
+  gcc_assert (symtab->state < IPA_SSA || targets.length () <= len);
   fprintf (f, "\n");
 }
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-24 12:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-24 11:03 Fix -fdump-ipa-all ICE Jan Hubicka
2017-04-24 11:25 ` Jakub Jelinek
2017-04-24 12:29   ` Martin Liška
2017-04-24 12:31     ` Jan Hubicka
2017-04-24 13:15       ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).