https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126164
Bug ID: 126164
Summary: ICE Segmentation fault -mabi=atpcs + spec barrier
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: mjires at gcc dot gnu.org
Target Milestone: ---
Target: arm-linux-gnueabi
Compiling reduced testcase c-c++-common/spec-barrier-1.c results in ICE.
$ cat spec-barrier-1.c
void e() {
if (__builtin_speculation_safe_value(0));
}
$ arm-linux-gnueabi-gcc spec-barrier-1.c -mabi=atpcs
during RTL pass: expand
spec-barrier-1.c: In function āeā:
spec-barrier-1.c:2:7: internal compiler error: Segmentation fault
2 | if (__builtin_speculation_safe_value(0));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x22b5781 internal_error(char const*, ...)
/home/mjires/git/GCC/master/gcc/diagnostic-global-context.cc:787
0xfedcb7 crash_signal
/home/mjires/git/GCC/master/gcc/toplev.cc:325
0x146a740 assemble_external_libcall(rtx_def*)
/home/mjires/git/GCC/master/gcc/varasm.cc:2865
0x976fd1 emit_library_call_value_1(int, rtx_def*, rtx_def*, libcall_type,
machine_mode, int, std::pair<rtx_def*, machine_mode>*)
/home/mjires/git/GCC/master/gcc/calls.cc:4491
0x14df850 emit_library_call(rtx_def*, libcall_type, machine_mode)
/home/mjires/git/GCC/master/gcc/rtl.h:4473
0x14df850 arm_emit_speculation_barrier_function()
/home/mjires/git/GCC/master/gcc/config/arm/arm.cc:34601
0x1d7a044 gen_speculation_barrier()
/home/mjires/git/GCC/master/gcc/config/arm/arm.md:13086
0xfea29b default_speculation_safe_value(machine_mode, rtx_def*, rtx_def*,
rtx_def*)
/home/mjires/git/GCC/master/gcc/targhooks.cc:2836
0x94c94f expand_speculation_safe_value
/home/mjires/git/GCC/master/gcc/builtins.cc:7799
0x96ea46 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
/home/mjires/git/GCC/master/gcc/builtins.cc:9044
0xae282a expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/home/mjires/git/GCC/master/gcc/expr.cc:12689
0xae3b1f expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/home/mjires/git/GCC/master/gcc/expr.cc:9633
0xaeecf1 store_expr(tree_node*, rtx_def*, int, bool, bool)
/home/mjires/git/GCC/master/gcc/expr.cc:6807
0xaf031f expand_assignment(tree_node*, tree_node*, bool)
/home/mjires/git/GCC/master/gcc/expr.cc:6503
0x9988dc expand_call_stmt
/home/mjires/git/GCC/master/gcc/cfgexpand.cc:3203
0x9988dc expand_gimple_stmt_1
/home/mjires/git/GCC/master/gcc/cfgexpand.cc:4243
0x9988dc expand_gimple_stmt
/home/mjires/git/GCC/master/gcc/cfgexpand.cc:4390
0x99f656 expand_gimple_basic_block
/home/mjires/git/GCC/master/gcc/cfgexpand.cc:6507
0x9a1328 execute
/home/mjires/git/GCC/master/gcc/cfgexpand.cc:7255
/home/mjires/built/master-arm-linux-gnueabi/libexec/gcc/arm-linux-gnueabi/17.0.0/cc1
-quiet spec-barrier-1.c -quiet -dumpdir a- -dumpbase spec-barrier-1.c
-dumpbase-ext .c -mabi=atpcs -mcpu=arm10tdmi -mtls-dialect=gnu -marm
-mlibarch=armv5t -march=armv5t -o /tmp/ccxFWW2T.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master-arm-linux-gnueabi/libexec/gcc/arm-linux-gnueabi/17.0.0/lto-wrapper
Target: arm-linux-gnueabi
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master-arm-linux-gnueabi --target=arm-linux-gnueabi
--disable-bootstrap --enable-languages=c,c++,fortran --disable-multilib
--enable-checking : (reconfigured) /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master-arm-linux-gnueabi --target=arm-linux-gnueabi
--disable-bootstrap --disable-multilib --enable-checking
target_alias=arm-linux-gnueabi --enable-languages=c,c++,fortran,lto --no-create
--no-recursion
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260708 (experimental) (GCC)