https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82381
Bug ID: 82381 Summary: internal compiler error: qsort checking failed Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: babokin at gmail dot com Target Milestone: --- GCC trunk rev 253307, x86_64. This looks like a fresh regression. I see quite many fails like this one. > cat f.cpp char b, h; unsigned short c, e; short d, f, g; void i() { if (h) { short a(-(d + c - b)); f = e - a - -d; } if (c) g = 0; } > g++ -O2 -c f.cpp f.cpp: In function ‘void i()’: f.cpp:4:6: error: qsort comparator non-negative on sorted output: 1 void i() { ^ during GIMPLE pass: reassoc f.cpp:4:6: internal compiler error: qsort checking failed 0x8fbc82 qsort_chk_error ../../gcc/gcc/vec.c:222 0x8fbcfb qsort_chk(void*, unsigned long, unsigned long, int (*)(void const*, void const*)) ../../gcc/gcc/vec.c:274 0x7d9118 vec<operand_entry*, va_heap, vl_embed>::qsort(int (*)(void const*, void const*)) ../../gcc/gcc/vec.h:973 0x7d9118 vec<operand_entry*, va_heap, vl_ptr>::qsort(int (*)(void const*, void const*)) ../../gcc/gcc/vec.h:1735 0x7d9118 reassociate_bb ../../gcc/gcc/tree-ssa-reassoc.c:5839 0x7d755b reassociate_bb ../../gcc/gcc/tree-ssa-reassoc.c:5979 0x7d755b reassociate_bb ../../gcc/gcc/tree-ssa-reassoc.c:5979 0x7d755b reassociate_bb ../../gcc/gcc/tree-ssa-reassoc.c:5979 0x109673c do_reassoc ../../gcc/gcc/tree-ssa-reassoc.c:6093 0x109673c execute_reassoc ../../gcc/gcc/tree-ssa-reassoc.c:6180 0x109673c execute ../../gcc/gcc/tree-ssa-reassoc.c:6219 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.