Fix ICE with -O0 -fdevirtualize

Submitted by Jan Hubicka on Sept. 6, 2013, 10:35 a.m.

Details

Message ID 20130906103540.GC12994@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka Sept. 6, 2013, 10:35 a.m.
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.

Patch hide | download patch | download mbox

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 {