https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125582
--- Comment #4 from Senthil Kumar Selvaraj <saaadhu at gcc dot gnu.org> ---
Can confirm it's the same bug. With the below testcase and mips-unknown-elf as
target (had to add -mabicalls), same stack trace, and gdb shows bb->il.x.rtx is
NULL.
$ mips-unknown-elf-gcc wrt.c -mips16 -O2 -fPIC -minterlink-mips16 -mabicalls
cc1: warning: cannot use small-data accesses for '-mabicalls'
during RTL pass: expand
In function 'get_getrandom_seed',
inlined from 'main' at wrt.c:18:9:
wrt.c:8:23: internal compiler error: Segmentation fault
8 | ret = getrandom(seed, sizeof(*seed), 0x0001);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x3175389 internal_error(char const*, ...)
/opt/developer/oss/src/gcc/gcc/diagnostic-global-context.cc:787
0x1a24a47 crash_signal
/opt/developer/oss/src/gcc/gcc/toplev.cc:325
0x1383a73 add_insn_after(rtx_insn*, rtx_insn*, basic_block_def*)
/opt/developer/oss/src/gcc/gcc/emit-rtl.cc:4375
0x13847a2 emit_pattern_after_noloc
/opt/developer/oss/src/gcc/gcc/emit-rtl.cc:4833
0x1384c5d emit_pattern_after
/opt/developer/oss/src/gcc/gcc/emit-rtl.cc:5010
0x1384cb9 emit_insn_after(rtx_def*, rtx_insn*)
/opt/developer/oss/src/gcc/gcc/emit-rtl.cc:5024
0x1f75d79 mips16_gp_pseudo_reg
/opt/developer/oss/src/gcc/gcc/config/mips/mips.cc:3414
0x1f75ef3 mips_pic_base_register(rtx_def*)
/opt/developer/oss/src/gcc/gcc/config/mips/mips.cc:3439
0x1f7609d mips_got_load(rtx_def*, rtx_def*, mips_symbol_type)
/opt/developer/oss/src/gcc/gcc/config/mips/mips.cc:3487
0x1f836a0 mips_load_call_address
/opt/developer/oss/src/gcc/gcc/config/mips/mips.cc:7591
0x1f85770 mips_expand_call(mips_call_type, rtx_def*, rtx_def*, rtx_def*,
rtx_def*, bool)
/opt/developer/oss/src/gcc/gcc/config/mips/mips.cc:8259
0x2ccd87f gen_call_value(rtx_def*, rtx_def*, rtx_def*, rtx_def*)
/opt/developer/oss/src/gcc/gcc/config/mips/mips.md:7291
0x1f6fdf4 target_gen_call_value
/opt/developer/oss/src/gcc/gcc/config/mips/mips.md:6827
0x11fd69e emit_call_1
/opt/developer/oss/src/gcc/gcc/calls.cc:471
0x1207801 expand_call(tree_node*, rtx_def*, int)
/opt/developer/oss/src/gcc/gcc/calls.cc:3771
0x13fee3d expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/opt/developer/oss/src/gcc/gcc/expr.cc:12816
0x13eeca5 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/opt/developer/oss/src/gcc/gcc/expr.cc:9656
0x13e2a50 store_expr(tree_node*, rtx_def*, int, bool, bool)
/opt/developer/oss/src/gcc/gcc/expr.cc:6830
0x13e0f4e expand_assignment(tree_node*, tree_node*, bool)
/opt/developer/oss/src/gcc/gcc/expr.cc:6526
0x1227319 expand_call_stmt
/opt/developer/oss/src/gcc/gcc/cfgexpand.cc:3238
(gdb) p bb->flags & BB_RTL
$1 = 0
(gdb) p bb->il.x
$2 = {head_ = 0x7ffff7b42738, rtl = 0x0}
(gdb)