https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97545
Bug ID: 97545 Summary: ICE since commit 90e88fd376b and using selective-scheduling2 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: stefansf at linux dot ibm.com Target Milestone: --- Created attachment 49433 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49433&action=edit reduced failing example Since commit 90e88fd376b compiling the attached program on S/390 results in: $ gcc -O3 -fselective-scheduling2 t.i during RTL pass: sched2 : In function 'main': :67:1: internal compiler error: Segmentation fault 0x21e3323 crash_signal /home/stefansf/devel/gcc-2/src/gcc/toplev.c:330 0x171da48 NEXT_INSN(rtx_insn const*) /home/stefansf/devel/gcc-2/src/gcc/rtl.h:1469 0x28be551 s390_sched_init /home/stefansf/devel/gcc-2/src/gcc/config/s390/s390.c:15129 0x213c1f7 sel_region_init /home/stefansf/devel/gcc-2/src/gcc/sel-sched.c:6929 0x213e5d7 sel_sched_region(int) /home/stefansf/devel/gcc-2/src/gcc/sel-sched.c:7624 0x213e853 run_selective_scheduling() /home/stefansf/devel/gcc-2/src/gcc/sel-sched.c:7720 0x2104d47 rest_of_handle_sched2 /home/stefansf/devel/gcc-2/src/gcc/sched-rgn.c:3738 0x21050b1 execute /home/stefansf/devel/gcc-2/src/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. whereas gcc -O3 -fselective-scheduling2 t.i -fevrp-mode=legacy works fine. It looks like as if current_sched_info->prev_head gets corrupted at some point. Adding a breakpoint prior the ICE and then trying to debug print results in: (gdb) call debug (current_sched_info->prev_head) (??? bad code 42405 )