https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80463
--- Comment #1 from amker at gcc dot gnu.org ---
Not sure which pass should be responsible for this.
The test uses un-initialized variable e, which could cause undefined behavior?
Also if I change the test into:
int *a;
int b, c;
void
d ()
{
for (int e = 0; c; e++)
switch (e)
{
case 0:
a[e] = 1;
case 1:
b = 2;
break;
default:
a[e] = 3;
}
}
Then r227842 has segmentation fault too, though at different place.
$ ./g++ pr80463.c -fselective-scheduling2 -O2 -c -fvar-tracking-assignments -S
pr80463.c:1:0: warning: var-tracking-assignments changes selective scheduling
int *a;
^
pr80463.c: In function ‘void d()’:
pr80463.c:17:1: internal compiler error: Segmentation fault
}
^
0xfaf6e2 crash_signal
../../gcc/gcc/toplev.c:352
0xb043e4 bb_note(basic_block_def*)
../../gcc/gcc/cfgrtl.c:679
0xf5d4dd sel_bb_head(basic_block_def*)
../../gcc/gcc/sel-sched-ir.c:4520
0xf6c739 moveup_expr_cached
../../gcc/gcc/sel-sched.c:2528
0xf74945 move_op_ascend
../../gcc/gcc/sel-sched.c:6151
0xf75548 code_motion_path_driver
../../gcc/gcc/sel-sched.c:6653
0xf756b9 move_op
../../gcc/gcc/sel-sched.c:6709
0xf729ef move_exprs_to_boundary
../../gcc/gcc/sel-sched.c:5226
0xf73541 schedule_expr_on_boundary
../../gcc/gcc/sel-sched.c:5438
0xf739b7 fill_insns
../../gcc/gcc/sel-sched.c:5580
0xf76e23 schedule_on_fences
../../gcc/gcc/sel-sched.c:7363
0xf77308 sel_sched_region_2
../../gcc/gcc/sel-sched.c:7501
0xf77491 sel_sched_region_1
../../gcc/gcc/sel-sched.c:7543
0xf778e4 sel_sched_region(int)
../../gcc/gcc/sel-sched.c:7644
0xf779fe run_selective_scheduling()
../../gcc/gcc/sel-sched.c:7720
0xf50167 rest_of_handle_sched2
../../gcc/gcc/sched-rgn.c:3628
0xf50340 execute
../../gcc/gcc/sched-rgn.c:3772
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.