Fix ICE with -O0 -fdevirtualize

Jan Hubicka hubicka@ucw.cz
Fri Sep 6 10:35:00 GMT 2013


Hi,
this patch fixes ICE with -O0 -fdevirtualize where we try to access type inheritance
graph that does not exist.

Bootstrapped/regtested x86_64-linux, comitted.

2013-09-06  Jan Hubicka  <jh@suse.cz>

	PR tree-optimization/58311
	* ipa-devirt.c (gate_ipa_devirt): Only execute when optimizing.

Index: ipa-devirt.c
===================================================================
--- ipa-devirt.c	(revision 202315)
+++ ipa-devirt.c	(working copy)
@@ -1114,9 +1114,7 @@ ipa_devirt (void)
 static bool
 gate_ipa_devirt (void)
 {
-  /* FIXME: We should remove the optimize check after we ensure we never run
-     IPA passes when not optimizing.  */
-  return flag_devirtualize && !in_lto_p;
+  return flag_devirtualize && !in_lto_p && optimize;
 }
 
 namespace {



More information about the Gcc-patches mailing list