https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82396

            Bug ID: 82396
           Summary: qsort comparator non-negative on sorted output: 4 in
                    ready_sort_real in haifa scheduler
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: arm-linux-gnueabi-gcc

Using cross-compiler one can see after Alexander's commit (r253295):

$ cat /tmp/tmp4qfnk1d3.i
int a, h;
struct b
{
  int c;
  double d;
  int f;
  double e;
};

struct b g;

int bar () { a = h; }
int i (int j, ...)
{
  __builtin_va_list b;
  while (j--)
    {
      __builtin_va_start (b, j);
      g = __builtin_va_arg(b, struct b);
      bar ();
    }
}

$ arm-linux-gnueabi-gcc -Ofast --param sched-autopref-queue-depth=274589698
/tmp/tmp4qfnk1d3.i
/tmp/tmp4qfnk1d3.i: In function ā€˜i’:
/tmp/tmp4qfnk1d3.i:22:1: error: qsort comparator non-negative on sorted output:
4
 }
 ^
during RTL pass: sched2
/tmp/tmp4qfnk1d3.i:22:1: internal compiler error: qsort checking failed
0x5925f2 qsort_chk_error
        .././../gcc/vec.c:222
0x13061a5 qsort_chk(void*, unsigned long, unsigned long, int (*)(void const*,
void const*))
        .././../gcc/vec.c:274
0x12233a8 ready_sort_real
        .././../gcc/haifa-sched.c:3087
0x122a60f schedule_block(basic_block_def**, void*)
        .././../gcc/haifa-sched.c:6749
0xb0473a schedule_region
        .././../gcc/sched-rgn.c:3174
0xb0473a schedule_insns()
        .././../gcc/sched-rgn.c:3513
0xb04c9d schedule_insns()
        .././../gcc/sched-rgn.c:3498
0xb04c9d rest_of_handle_sched2
        .././../gcc/sched-rgn.c:3737
0xb04c9d execute
        .././../gcc/sched-rgn.c:3873

Reply via email to