Hello ! The following testcase makes GCC 4.9.0 as of 20130921 crash. $ cat vfi.c void f(int p, short q) { f(0, 0); } $ xgcc -O3 -fipa-pta vfi.c vfi.c: In function ‘f’: vfi.c:1:6: error: control flow in the middle of basic block 2 void f(int p, short q) ^ vfi.c:1:6: internal compiler error: verify_flow_info failed 0x617352 verify_flow_info() ../../srcdir/gcc/cfghooks.c:260 0x958d3a cleanup_tree_cfg_noloop ../../srcdir/gcc/tree-cfgcleanup.c:696 0x958d3a cleanup_tree_cfg() ../../srcdir/gcc/tree-cfgcleanup.c:745 0x87f724 execute_function_todo ../../srcdir/gcc/passes.c:1791 0x87fe17 execute_todo ../../srcdir/gcc/passes.c:1866 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.
Results in <bb2> f.constprop (); return; and f.constprop is stmt_ends_bb_p () now, the original recursion isn't. That's because it's likely got an endless loop and noreturn? calling out IPA-PTA is probably bogus. f is found const by IPA pure const (but f.constprop isn't updated via clone hook?) and ends up const looping. IPA-PTA doesn't do anything and copyprop simply first triggers verification.
With -fipa-pta at t.c.054t.copyrename2 we have f.constprop () { <bb 2>: f.constprop (); return; } f (int p, short int q) { <bb 2>: f.constprop (); return; } but without -fipa-pta we get f (int p, short int q) { <bb 2>: f.constprop (); } appearantly /* SIPLE IPA passes do not handle callgraphs with IPA transforms in it. Apply all trnasforms first. */ if (pass->type == SIMPLE_IPA_PASS) { bool applied = false; do_per_function (apply_ipa_transforms, (void *)&applied); if (applied) symtab_remove_unreachable_nodes (true, dump_file); /* Restore current_pass. */ current_pass = pass; } breaks things because we instantiate the clone before executing late local-pure-const for f.constprop () this way and thus miss the state change in the caller and the fixup-cfg required by it. In 4.8 we had as first pass in all_passes a pass_fixup_cfg but appearantly I removed that(?) ... Mine.
Author: rguenth Date: Tue Nov 5 15:09:40 2013 New Revision: 204399 URL: http://gcc.gnu.org/viewcvs?rev=204399&root=gcc&view=rev Log: 2013-11-05 Richard Biener <rguenther@suse.de> PR ipa/58492 * passes.def (all_passes): Start with pass_fixup_cfg again. * gcc.dg/ipa/pr58492.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/ipa/pr58492.c Modified: trunk/gcc/ChangeLog trunk/gcc/passes.def trunk/gcc/testsuite/ChangeLog
Fixed.