https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84345
Bug ID: 84345 Summary: [8 Regression] ICE: qsort checking failed (error: qsort comparator non-negative on sorted output: 1) Product: gcc Version: 8.0 Status: UNCONFIRMED Keywords: ice-checking, ice-on-valid-code Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- Target: x86_64-unknown-linux-gnu gcc-8.0.0-alpha20180211 snapshot (r257571) ICEs when compiling the following snippet w/ -O2 -fsched2-use-superblocks -ftree-parallelize-loops=2 -fno-sched-critical-path-heuristic -fno-tree-dce --param tracer-min-branch-probability=49: int zq, h9; void m0 (unsigned long int sc) { zq = 0; if (sc == 0 && h9 == 0) for (sc = 0; sc < 200; ++sc) { } } % gcc-8.0.0-alpha20180211 -O2 -fsched2-use-superblocks -ftree-parallelize-loops=2 -fno-sched-critical-path-heuristic -fno-tree-dce --param tracer-min-branch-probability=49 -c nx05nihn.c nx05nihn.c: In function 'm0': nx05nihn.c:12:1: error: qsort comparator non-negative on sorted output: 1 } ^ during RTL pass: sched2 nx05nihn.c:12:1: internal compiler error: qsort checking failed 0x7428bc qsort_chk_error /var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/vec.c:201 0x742923 qsort_chk(void*, unsigned long, unsigned long, int (*)(void const*, void const*)) /var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/vec.c:253 0x1479810 ready_sort_real /var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/haifa-sched.c:3086 0x14818e4 schedule_block(basic_block_def**, void*) /var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/haifa-sched.c:6674 0x150681b schedule_ebb(rtx_insn*, rtx_insn*, bool) /var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/sched-ebb.c:537 0x1506ee4 schedule_ebbs() /var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/sched-ebb.c:657 0xc4c294 rest_of_handle_sched2 /var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/sched-rgn.c:3735 0xc4c294 execute /var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/sched-rgn.c:3873