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 <j...@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 {