Command line: $ gcc -O1 -fgcse -finline-small-functions -freorder-blocks -fschedule-insns2 -ftree-vrp -finline-functions -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -ftracer testcase.c or $ gcc -O2 -finline-functions -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -ftracer testcase.c or $ gcc -O3 -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -ftracer testcase.c Compiler output: $ gcc -O1 -fgcse -finline-small-functions -freorder-blocks -fschedule-insns2 -ftree-vrp -finline-functions -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -ftracer testcase.c testcase.c: In function 'parser_get_next_parameter': testcase.c:26:1: internal compiler error: in cfg_preds_1, at sel-sched-ir.c:4584 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Tested revisions: r163921 - crash r161659 - crash r161170 - OK
Created attachment 21721 [details] reduced testcase
Neither of these option combinations fail for me on x86-64 with a recent trunk (164506). We will investigate further with the given trunk revisions.
Confirmed. It is hidden now by 163998. The problem is simple, yet again when inserting a bookkeeping code together with pipelining outer loops, we can see the situation when we need to devise a positive seqno for a bookkeeping insn, yet we can't do that by examining its neighbours. Fixed by relaxing the failing assert so that the first patch for PR40101 would provide an arbitrary positive value. diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 853205d..8a88c55 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -4580,8 +4580,12 @@ cfg_preds_1 (basic_block bb, insn_t **preds, int *n, int *size) basic_block pred_bb = e->src; insn_t bb_end = BB_END (pred_bb); - /* ??? This code is not supposed to walk out of a region. */ - gcc_assert (in_current_region_p (pred_bb)); + if (!in_current_region_p (pred_bb)) + { + gcc_assert (flag_sel_sched_pipelining_outer_loops + && current_loop_nest); + continue; + } if (sel_bb_empty_p (pred_bb)) cfg_preds_1 (pred_bb, preds, n, size); @@ -4594,7 +4598,9 @@ cfg_preds_1 (basic_block bb, insn_t **preds, int *n, int *size) } } - gcc_assert (*n != 0); + gcc_assert (*n != 0 + || (flag_sel_sched_pipelining_outer_loops + && current_loop_nest)); } /* Find all predecessors of BB and record them in PREDS and their number
Author: abel Date: Thu Oct 14 07:56:47 2010 New Revision: 165454 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165454 Log: PR rtl-optimization/45570 * sel-sched-ir.c (cfg_preds_1): When walking out of the region, assert that we are pipelining outer loops. Allow returning zero predecessors. * gcc.dg/pr45570.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr45570.c Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched-ir.c trunk/gcc/testsuite/ChangeLog
Fixed.
Author: abel Date: Thu Apr 7 06:50:08 2011 New Revision: 172077 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172077 Log: Backport from mainline 2010-10-14 Andrey Belevantsev <abel@ispras.ru> PR rtl-optimization/45570 * sel-sched-ir.c (cfg_preds_1): When walking out of the region, assert that we are pipelining outer loops. Allow returning zero predecessors. Added: branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/pr45570.c Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/sel-sched-ir.c branches/gcc-4_5-branch/gcc/testsuite/ChangeLog