https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126513
Bug ID: 126513
Summary: ICE ‘verify_gimple’ failed, since
__builtin_ppc_atomic_cas_local added in r17-1992
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: mjires at gcc dot gnu.org
CC: avinashd at gcc dot gnu.org
Target Milestone: ---
Target: ppc64le-linux-gnu
Compiling reduced testcase gcc.target/powerpc/acmp-tst.c results in ICE since
added in r17-1992-ge4543a6ecc97a7.
$ cat acmp-tst.c
__int128 word_exchange_uti_ptr;
int word_exchange_uti_expected;
unsigned word_exchange_uti_desired() {
__builtin_ppc_atomic_cas_local(
&word_exchange_uti_ptr, word_exchange_uti_expected,
word_exchange_uti_desired, 0, __ATOMIC_SEQ_CST, __ATOMIC_ACQUIRE);
}
Unreduced testcase failed with -mno-quad-memory-atomic, but reduced fails
without it:
$ ppc64le-linux-gnu-gcc acmp-tst.c
acmp-tst.c: In function ‘word_exchange_uti_desired’:
acmp-tst.c:3:10: error: conversion of register to a different size in
‘view_convert_expr’
3 | unsigned word_exchange_uti_desired() {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
VIEW_CONVERT_EXPR<__int128 unsigned *>(word_exchange_uti_expected.0_1);
_2 = VIEW_CONVERT_EXPR<__int128 unsigned *>(word_exchange_uti_expected.0_1);
acmp-tst.c:3:10: internal compiler error: ‘verify_gimple’ failed
0x2249697 internal_error(char const*, ...)
/home/mjires/git/GCC/master/gcc/diagnostic-global-context.cc:787
0x105275f verify_gimple_in_seq(gimple*, bool)
/home/mjires/git/GCC/master/gcc/tree-cfg.cc:5216
0xc42ba8 gimplify_body(tree_node*, bool)
/home/mjires/git/GCC/master/gcc/gimplify.cc:21899
0xc42caa gimplify_function_tree(tree_node*)
/home/mjires/git/GCC/master/gcc/gimplify.cc:22025
0x9f72ef cgraph_node::analyze()
/home/mjires/git/GCC/master/gcc/cgraphunit.cc:691
0x9fa6e2 analyze_functions
/home/mjires/git/GCC/master/gcc/cgraphunit.cc:1270
0x9fb9aa symbol_table::finalize_compilation_unit()
/home/mjires/git/GCC/master/gcc/cgraphunit.cc:2593
/home/mjires/built/master-ppc64le-linux-gnu/libexec/gcc/ppc64le-linux-gnu/17.0.0/cc1
-quiet acmp-tst.c -quiet -dumpdir a- -dumpbase acmp-tst.c -dumpbase-ext .c -o
/tmp/ccKyMSHA.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.
$ ppc64le-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=ppc64le-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master-ppc64le-linux-gnu/libexec/gcc/ppc64le-linux-gnu/17.0.0/lto-wrapper
Target: ppc64le-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master-ppc64le-linux-gnu --target=ppc64le-linux-gnu
--disable-bootstrap --enable-languages=c,c++,fortran --disable-multilib
--enable-checking : (reconfigured) /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master-ppc64le-linux-gnu --target=ppc64le-linux-gnu
--disable-bootstrap --enable-languages=c,c++,fortran --disable-multilib
--enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260730 (experimental) (GCC)