Patchwork Fix ICE with -O0 -fdevirtualize

login
register
mail settings
Submitter Jan Hubicka
Date Sept. 6, 2013, 10:35 a.m.
Message ID <20130906103540.GC12994@kam.mff.cuni.cz>
Download mbox | patch
Permalink /patch/273143/
State New
Headers show

Comments

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

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 {