Bug 99469 - [11/12/13/14/15 Regression] ICE: qsort checking failed with selective scheduling on aarch64
Summary: [11/12/13/14/15 Regression] ICE: qsort checking failed with selective schedul...
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 11.0
: P4 normal
Target Milestone: 11.5
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: qsort_chk selective-scheduling
  Show dependency treegraph
 
Reported: 2021-03-08 16:28 UTC by Alex Coplan
Modified: 2024-04-26 10:39 UTC (History)
4 users (show)

See Also:
Host:
Target: aarch64
Build:
Known to work:
Known to fail: 11.0
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Coplan 2021-03-08 16:28:27 UTC
The following fails:

$ cat test.c
typedef struct {
  int a[3];
} s;
s ss[1][5][8];

int g();
void h(s);
int foo(char *, ...);

void f() {
  int a, b, c, d = 0;
  if (g())
    d = 1;
  for (; a; a++) {
    if (d)
      foo("a", "");
    h(ss[a][b][c]);
    if (d)
      foo("a");
  }
}

$ aarch64-linux-gnu-gcc -c test.c -O2 -fselective-scheduling -fselective-scheduling2 -fsel-sched-pipelining -mtune=cortex-a53
test.c: In function ‘f’:
test.c:21:1: error: qsort comparator not anti-symmetric: -1, -1
   21 | }
      | ^
during RTL pass: sched2
test.c:21:1: internal compiler error: qsort checking failed
0x1c2b727 qsort_chk_error
        /home/alecop01/toolchain/src/gcc/gcc/vec.c:214
0x1c2bc7d qsort_chk(void*, unsigned long, unsigned long, int (*)(void const*, void const*, void*), void*)
        /home/alecop01/toolchain/src/gcc/gcc/vec.c:258
0x1c62d8e gcc_qsort(void*, unsigned long, unsigned long, int (*)(void const*, void const*))
        /home/alecop01/toolchain/src/gcc/gcc/sort.cc:270
0xda2728 vec<_expr*, va_heap, vl_embed>::qsort(int (*)(void const*, void const*))
        /home/alecop01/toolchain/src/gcc/gcc/vec.h:1148
0xda2728 vec<_expr*, va_heap, vl_ptr>::qsort(int (*)(void const*, void const*))
        /home/alecop01/toolchain/src/gcc/gcc/vec.h:2041
0xda2728 fill_vec_av_set
        /home/alecop01/toolchain/src/gcc/gcc/sel-sched.c:3717
0xda65d2 fill_ready_list
        /home/alecop01/toolchain/src/gcc/gcc/sel-sched.c:4014
0xda65d2 find_best_expr
        /home/alecop01/toolchain/src/gcc/gcc/sel-sched.c:4374
0xda65d2 fill_insns
        /home/alecop01/toolchain/src/gcc/gcc/sel-sched.c:5535
0xda65d2 schedule_on_fences
        /home/alecop01/toolchain/src/gcc/gcc/sel-sched.c:7353
0xda65d2 sel_sched_region_2
        /home/alecop01/toolchain/src/gcc/gcc/sel-sched.c:7491
0xda9508 sel_sched_region_1
        /home/alecop01/toolchain/src/gcc/gcc/sel-sched.c:7533
0xda9e2f sel_sched_region(int)
        /home/alecop01/toolchain/src/gcc/gcc/sel-sched.c:7634
0xdab3cf run_selective_scheduling()
        /home/alecop01/toolchain/src/gcc/gcc/sel-sched.c:7720
0xd85b1c rest_of_handle_sched2
        /home/alecop01/toolchain/src/gcc/gcc/sched-rgn.c:3738
0xd85b1c execute
        /home/alecop01/toolchain/src/gcc/gcc/sched-rgn.c:3882
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.
Comment 1 Alex Coplan 2021-03-08 19:19:33 UTC
FWIW this is easy to reproduce with either csmith or yarpgen, so should be straightforward to procure a new testcase if the above goes latent.
Comment 2 Alexander Monakov 2021-03-09 13:03:17 UTC
Related: PR 84566
Comment 3 Alex Coplan 2021-03-31 14:14:21 UTC
Started with r8-6635-g3f26f054872c375e7f9a80ede7a56036d9b57597.
Comment 4 Jakub Jelinek 2021-05-14 09:54:33 UTC
GCC 8 branch is being closed.
Comment 5 Richard Biener 2021-06-01 08:19:52 UTC
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
Comment 6 Richard Biener 2022-05-27 09:44:40 UTC
GCC 9 branch is being closed
Comment 7 Jakub Jelinek 2022-06-28 10:43:51 UTC
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
Comment 8 Richard Biener 2023-07-07 10:39:10 UTC
GCC 10 branch is being closed.